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

Michael Haubenwallner michael.haubenwallner@ssi-schaefer.com
Wed Oct 23 13:20:00 GMT 2019

On 10/22/19 12:06 PM, Michael Haubenwallner wrote:
> On 10/22/19 10:04 AM, Corinna Vinschen wrote:
>> On Oct 22 09:20, Michael Haubenwallner wrote:
>>> On 10/18/19 1:37 PM, Takashi Yano wrote:
>>>> +      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).
>> In terms of clearing the screen at all, what's your opinion, Michael?
> While I do not fully understand TTY handling, clearing the screen because
> just opening a PTY doesn't feel correct.
> To start with, attached is some python script where I do not expect to see
> the initial clear screen code, but the one from /usr/bin/clear only.

> Interesting enough, cygwin-3.0.7 does dump core somewhere in between, so the real
> python program probably does some additional setup I've not extracted yet.

Sorry, the issue with cygwin-3.0.7 probably was because I've built my python3
against cygwin-3.1. Using Cygwin python 2 or 3 it does work with cygwin-3.0.7.

Here's an improved version, with additional initialization found in the real
world program - doesn't make a significant difference.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ptytest2.py
Type: text/x-python
Size: 2826 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20191023/5525c756/attachment.py>

More information about the Cygwin-patches mailing list