[PATCH] Cygwin: pty: Disable clear screen for ssh sessions with -t option.

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Oct 18 14:33:00 GMT 2019


Hi Takashi,

On Oct 18 20:37, Takashi Yano wrote:
> ---
>  winsup/cygwin/fhandler_tty.cc | 21 ++++++++++++++++++++-
>  winsup/cygwin/tty.cc          |  1 +
>  winsup/cygwin/tty.h           |  1 +
>  3 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
> index da6119dfb..163f93f35 100644
> --- a/winsup/cygwin/fhandler_tty.cc
> +++ b/winsup/cygwin/fhandler_tty.cc
> @@ -1305,6 +1305,20 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
>    if (bg <= bg_eof)
>      return (ssize_t) bg;
>  
> +  if (get_ttyp ()->need_clear_screen_on_write)
> +    {
> +      const char *term = getenv ("TERM");
> +      if (term && strcmp (term, "dumb") && !strstr (term, "emacs") &&
> +	  wcsstr (myself->progname, L"\\usr\\sbin\\sshd.exe"))

Sorry, but this doesn't look feasible.

You can't base the behaviour on the name of an application.  What about
other applications like telnetd, rshd, just to name the first ones
coming to mind?  What about a renamed sshd, or sshd installed into
another directory, or just an sshd in the build dir during testing?

Is this workaround really necessary at all?  Even basing this on the
terminal name looks pretty fragile.

Why exactly is the clear screen necessary?  You wrote something about
synchronizing the pseudo console and the pseudo tty content, IIRC, but
it still seems artificial to enforce a clear screen.  Is there no
other way to make the pseudo console happy?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20191018/e6ffd4c7/attachment.sig>


More information about the Cygwin-patches mailing list