X-Recipient: archive-cygwin@delorie.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:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=I4xUQX7A/NhI1RQub6qAT88ScV5A7+zzOTNLR9hTMSq
	DDGVs4pc4aF7eSpyU5QIYGenGzjzCA5syS+AlR+2qKNZcczCfs5WxePZJbSP7L/O
	kzfnI2xg76P99ykizjvfEcIDxq5YEXUSVCaYH+JRJt78jgOBK38Sgdv5Mp5arEOA
	=
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:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:content-type:content-transfer-encoding;
	 s=default; bh=RJEbyhHncY0EYAbfSZGX6wN5RSQ=; b=pUfKy10/35NvlLdAb
	dOWXaXlyIHv4QOEM79zXvPzP8pgv4DXj8Fj7SuzFHVM/Bt3LoVA7TmTxZm31cUOw
	Us87ZbG3S4KX5Viwo9kFKAKmrwWWN7rR3hwzWG8wQga+qYrjaM8935PHpzge17bB
	0XL0Ap+HdJtI7jvOQALxTvE7Lg=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=20202, screen
X-HELO: mail-lj1-f170.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=mime-version:references:in-reply-to:from:date:message-id:subject:to         :content-transfer-encoding;        bh=oCSXK5zXNMRUKA2QTo07S+HVCGaZE8AQ6lzCagaDB2U=;        b=XTka1ZWYoPypc83vZNF4486GnR/zWeGu33ZNyLrHU8hwNpUbGREXPM5p/6G9SjvTuY         EgR/koCaLfC41Tq8tkXojb7lV41V/A2p6sc/PuMGDpuKmhCrJiuW5DtLlmg6lCSCjkh6         VJuaedZAzfcY86SQNmbF7QF00PgEa+PEfPM2rdyWKYesuvs9SAzyzP4pXmYgQ9Tml+6x         Fj9/c8BnUdNQMVIbGBKz+Mak7jAiBbvBHC4EXLUT7UqbxX0CpxQEP9sjak40VCl9A4wI         z3L8pykrUGVYYznCeCJmCu5bU0fv7wBO1h+k8yRgNwTM5IMf8/xL8VUYSRqw9YiTaBKl         HpOA==
MIME-Version: 1.0
References: <CAFLRLk-GK_kCL6Wdf=TSR-fNwsuf3BDv-C465S6RFX0hNRqQFw@mail.gmail.com> <20200208232500.8d938b55f031316e196a1e84@nifty.ne.jp>
In-Reply-To: <20200208232500.8d938b55f031316e196a1e84@nifty.ne.jp>
From: Koichi Murase <myoga.murase@gmail.com>
Date: Sat, 8 Feb 2020 23:29:09 +0800
Message-ID: <CAFLRLk9uE=ffMnW6zWpCAGkq4SzhzZpp=h4eiWgeyGaLPsnWOA@mail.gmail.com>
Subject: Re: Cygwin-3.1.3: Terminal contents are overwritten by less graphical ones on the start of non-Cygwin programs
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 018FTvaf028396

Thank you for your quick response and the explanations and pointers to
related discussions.

2020年2月8日(土) 22:25 Takashi Yano
> From https://www.cygwin.com/ml/cygwin/2019-10/msg00063.html
>
> The pseudo console has its own screen buffer behind, and redraws the
> screen based on the screen buffer at undetermined timing.

I'm not sure if I correctly understand the situation, but does this
mean we cannot prevent the pseudo console from redrawing the screen
(i.e., sending some texts and escape sequences to the terminal
emulators) based on its background screen buffer?  For that reason do
we need to keep the terminal contents of both the terminal emulator
and the background screen consistent with each other?

> > * The problem is not restricted in just clearing graphic styles of
> >   characters.  For GNU Screen I use Screen-specific terminal sequences
> > (snip)
>
> How can I reproduce this?

For example, in GNU screen,

  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$
$BASH_COMMAND\e\\\][\u@\h \j \W]\$ '
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$
  [user@hostname 0 ~]$ ./nocyg

where ./nocyg is the program in the original mail.  Then it turnes
into something like:

  [user@hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h
\[\e[33m\]\w\[\e[[user
  @hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[
  [user@hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[
  0m\]\n\$ '[user@hostname 0 ~]$

  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
   \W]\$ '[user@hostname 0 ~]$
  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
   \W]\$ '[user@hostname 0 ~]$
  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
   \W]\$ '[user@hostname 0 ~]$
  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
   \W]\$ '[user@hostname 0 ~]$
  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
   \W]\$ '[user@hostname 0 ~]$
  [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j
   \W]\$ '[user@hostname 0 ~]$ ./nocyg
  [user@hostname 0 ~]$

> > * As well as non-Cygwin programs, also Cygwin programs `ssh', `scp' or
> >   `git push/pull' with SSH connections cause the same results.  I
> >   guess SSH utilities internally use non-Cygwin programs.  (Actually I
> >   originally faced with this problem with these "Cygwin" commands.)
>
> I cannot reproduce this. Cygwin ssh, scp and git does not triggers
> redraw screen in my environment.
>
> Do you surely execute *cygwin* command rather that windows one?

Yes, I'm using those commands from Cygwin (the command "type ssh scp
git" shows /usr/bin/... for all of them).

I'm sorry I found the reason.  I have been specifying a shell script
for the SSH option `ProxyCommand' in my `~/.ssh/config'.  In that
shell script, I was using a Windows system command to retrieve the
current network configuration.


Thank you,

Koichi

--
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


