delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/04/09/23:18:40

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=GNAvB7OpstsDybKU
hu9Jmb6uwdKFLu60sBp9rmqZmb5NsqSR2At7orLXvonib4QZ6ECk+TjQ1Qir+Wsm
9qE3Ig0oAJvLhRysH8HNw9ILPhtrMDdsGhfWHy29G9C+VSebpady04GeoDBOeTrI
fLG+Jmo02CUXr7agIWu4DFmDnw0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=Y07UtMRWpnUgkS+VdFdWj/
IdqjA=; b=AxURpoJn34dbqZn5uM5mlIPrLvgNmfRwNX91oSpN3kRd3RalrmAfmx
u2j/QA39Gws9C31vG0EUY4zaWvQ0tW08430Y1AtkqXkdjOZOYVFUr9ra7TaaH6Wj
7X9+ZIRRhpxXwRg0tLaGR5cJBY1SbNLJTYcWUedQYnB0pXQSSDduw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Subject: Re: *cause of* screen writing over restored buffer on detach/exit
To: cygwin AT cygwin DOT com
References: <56fced2e-4f98-7bba-136b-5eeded34ce6f AT shaddybaddah DOT name> <6cc3bc5e-2c3c-61a1-8473-8c531faceac7 AT shaddybaddah DOT name>
From: Shaddy Baddah <lithium-cygwin AT shaddybaddah DOT name>
Message-ID: <b0290101-3511-9ffb-91d3-e88afdbe9df1@shaddybaddah.name>
Date: Wed, 10 Apr 2019 13:18:19 +1000
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>
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019