From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67854 invoked by alias); 10 Apr 2019 03:18:28 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 67833 invoked by uid 89); 10 Apr 2019 03:18:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.1 spammy=osc, Normal, baddah, Baddah X-HELO: nsstlmta12p.bpe.bigpond.com Received: from nsstlmta12p.bpe.bigpond.com (HELO nsstlmta12p.bpe.bigpond.com) (203.38.21.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Apr 2019 03:18:25 +0000 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep12p-svc.bpe.nexus.telstra.com.au with ESMTP id <20190410031821.TKEK16250.nsstlfep12p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com> for ; Wed, 10 Apr 2019 13:18:21 +1000 Received: from [0.0.0.0] (101.191.137.20) by smtp.telstra.com (9.0.019.26-1) id 5C46A8B42327C842 for cygwin@cygwin.com; Wed, 10 Apr 2019 13:18:21 +1000 Subject: Re: *cause of* screen writing over restored buffer on detach/exit To: cygwin@cygwin.com References: <56fced2e-4f98-7bba-136b-5eeded34ce6f@shaddybaddah.name> <6cc3bc5e-2c3c-61a1-8473-8c531faceac7@shaddybaddah.name> From: Shaddy Baddah Message-ID: Date: Wed, 10 Apr 2019 03:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6cc3bc5e-2c3c-61a1-8473-8c531faceac7@shaddybaddah.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00080.txt.bz2 On 9/4/19 4:07 pm, Shaddy Baddah wrote: > > This helped with screen when using Putty to a Cygwin ssh session. For > some reason, it isn't helping for running screen locally in a mintty > session. And it's not mintty either, because I can ssh to a Debian > stretch server within mintty and I can use its screen without this > issue happening. Back to the drawing board for me. I understand the cause of the issue now, by capturing and comparing the escape characters used to control the terminal by screen on Cygwin and Debian. It is not so much the detach/exit is the issue, although the escape sequence for Cygwin includes a couple of extra xterm OSC Set Text Parameters -> Change Icon Name and Window Title outputs. I misdiagnosed this somehow. I can suppress the extra utmp error one of these OSC outputs, but it didn't/doesn't really make a difference. The issue is in the escape sequences sent to the terminal by Cygwin screen to switch to new windows buffer, as compared to Debian. Debian uses xterm sequence DECSET / ESC[?1049h in the switch to the new window. Cygwin uses the two sequences ESC7 / Save Cursor (DECSC) and ESC[?47l / DEC Private Mode Reset (DECRST) -> Use Normal Screen Buffer. The reason seems to be that the Debian screen package packages a custom /etc/screenrc that does not include this explicit term capability: # # Do not use xterms alternate window buffer. # This one would not add lines to the scrollback buffer. termcap xterm|xterms|xs ti=\E7\E[?47l terminfo xterm|xterms|xs ti=\E7\E[?47l If I comment these out, my screen issue is resolved. I'm not suggesting this is a problem with Cygwin screen... it is using the upstream settings. In fact, I am not confident to say where the fault lies. Perhaps screen is right to use these sequences, but the xterms used (putty and mintty) aren't doing the right thing? In any case, I am glad to have found this workaround. -- Regards, Shaddy -- 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