On 10/11/19 11:24 AM, Takashi Yano wrote: > Hi Michael, > > On Thu, 10 Oct 2019 12:43:56 +0200 > Michael Haubenwallner wrote: >> I'm encountering another strange behaviour I do not remember to have seen >> before: >> >> Using ssh from some Linux xterm into the Cygwin sshd running on Server 2019 >> does clear the current terminal content as if /usr/bin/clear was executed. > > This is intentional behaviour. > > The pseudo console has its own screen buffer behind, and redraws > the screen based on the screen buffer at undetermined timing.> The screen > buffer is empty at the beginning, so the screen should > be cleared at the opening of the pty so that the real screen and > the screen buffer are synchronozed. > > The clear screen is prevented when TERM=dumb, so you can see what > happens if clear screen is not done by following steps.> > 1) Execute ls or ps to draw something to screen. > 2) env TERM=dumb ssh <cygwin-hostname> > 3) Execute cmd.exe.
Well... even that one is counter intuitive regarding the 'Last login' line. After login into Cygwin sshd, the 'Last login' line is not shown: haubi@linuxbox ~ $ ssh cygwin2019 ---------------------------------------- > > haubi@cygwin2019 ~ > $ > > > > > > > ---------------------------------------- When starting cmd, the terminal does loose colors, and the 'Last login' line suddenly is shown as first line: ---------------------------------------- > Last login: Mon Oct 14 12:30:52 2019 from 192.168.56.1 > > haubi@cygwin2019 ~ > $ cmd > Microsoft Windows [Version 10.0.17763.805] > (c) 2018 Microsoft Corporation. All rights reserved. > > C:\cygwin64\home\haubi> > > ---------------------------------------- However, with TERM=dumb, the terminal content is: ---------------------------------------- > {some output from previous linux commands} > {some output} > {some output} > {some output} > {some output} > haubi@linuxbox ~ $ TERM=dumb ssh cygwin2019 > Last login: Mon Oct 14 12:37:24 2019 from 192.168.56.1 > > haubi@cygwin2019 ~ > $ ---------------------------------------- And when cmd was started: ---------------------------------------- > Last login: Mon Oct 14 12:37:24 2019 from 192.168.56.1 > > haubi@cygwin2019 ~ > $ cmd > Microsoft Windows [Version 10.0.17763.805] > (c) 2018 Microsoft Corporation. All rights reserved. > > C:\cygwin64\home\haubi> > > ---------------------------------------- Actually I do prefer the TERM=dumb behaviour, having the current terminal buffer content get redrawn at line 1 when cmd is started only, not when running just Cygwin programs. My real problem is more sophisticated, and boils down to the creation of some pty's in a row, each having some commands run inside, and I do expect to see the output of each command while the series runs and when done, much like: ---------------------------------------- > {some output from previous linux commands} > {some output} > {some output} > haubi@linuxbox ~ $ ssh -t cygwin2016 hostname; hostname; ssh -t cygwin2016 > hostname > cygwin2016 > Connection to cygwin2016 closed. > linuxbox > cygwin2016 > Connection to cygwin2016 closed. > haubi@linuxbox ~ $ ---------------------------------------- And looking at the code actually makes me belive that even emacs does have troubles when the clear screen code is emitted on pty creation... Thanks! /haubi/ (in hope that "embedding the screen shots" does work) -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple