This is the mail archive of the cygwin-patches mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Hi Takashi,

On Oct 18 20:37, Takashi Yano wrote:
> ---
>  winsup/cygwin/ | 21 ++++++++++++++++++++-
>  winsup/cygwin/          |  1 +
>  winsup/cygwin/tty.h           |  1 +
>  3 files changed, 22 insertions(+), 1 deletion(-)
> diff --git a/winsup/cygwin/ b/winsup/cygwin/
> index da6119dfb..163f93f35 100644
> --- a/winsup/cygwin/
> +++ b/winsup/cygwin/
> @@ -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?


Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]