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

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Oct 22 08:04:00 GMT 2019


On Oct 22 09:20, Michael Haubenwallner wrote:
> Hi Takashi,
> 
> On 10/18/19 1:37 PM, 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"))
> 
> 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: prefix.gentoo.org
> 
> Thanks!
> /haubi/

In terms of clearing the screen at all, what's your opinion, Michael?


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/20191022/a35d160c/attachment.sig>


More information about the Cygwin-patches mailing list