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 10/18/19 1:37 PM, 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"))

Again, my real problem does not utilize ssh at all, but is some python script
using multiple pty.openpty() to spawn commands inside, to allow for herding
all the subprocesses started by the commands (Ctrl-C or similar).

The ssh -t is just the sample showing a similar effect.

Unfortunately, I'm not deep enough into that python script to quickly provide
a test case with pty.openpty() combined with all the tty settings used there.

I've started to extract the important bits, but that may take a while.  OTOH,
this is an open source project if you like to try yourself:


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