delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/05/05/09:07:31

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A5003857434
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1620220046;
bh=kcEZcKWBdBmG7q3OBeP1ufwk2RU/aAnm4siGh7nxT+0=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=ywssbaN0JRLsuatwEZIXrxwauvJc44hRmaFOhAbUCz2wz3yq4SWbpky8EaOwLe9kR
841ze6cpNdkAX2nomlD2rzhcC7LBlZA6L6EAage7Eb+g9qgLHzoOkzKYhd39DtIiwZ
1yKh6Ir89M14Fngs6SA6exXtuPliSrYwpXTZpNAI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5F01C3857400
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Date: Wed, 5 May 2021 15:07:04 +0200 (CEST)
X-X-Sender: virtualbox AT gitforwindows DOT org
To: Kevin Locke <kevin AT kevinlocke DOT name>
Subject: Re: Screen clearing in CMD without "Legacy Console Mode"
In-Reply-To: <YIwcGRttJhUueeRG@kevinlocke.name>
Message-ID: <nycvar.QRO.7.76.6.2105051500410.50@tvgsbejvaqbjf.bet>
References: <YIwTSMfJu9uMwrKn AT kevinlocke DOT name>
<20210430235358 DOT 2ae6daa41e3f0b6cb0daa173 AT nifty DOT ne DOT jp>
<YIwcGRttJhUueeRG AT kevinlocke DOT name>
User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23)
MIME-Version: 1.0
X-Provags-ID: V03:K1:VbL0AQtrX1KTybowGFYeiv8gqv0LPecdhREltEZY4CA0ONKVmvG
x43VxH3/6+hYNGEIHzsY7IN0jbxdoQakK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KvBCkVEVcyTwzjwD2cEfhs6WeekHqprk
kfGzDkfJjduXUiXAtFrkSeS7VyQRzn6wN9F2w8jjLT5bd8GCVyeRu24u1vdRS7EKdRxbjqVNQ
QMg+CYK8y5zlwr7JIgeskFEmeDtApO6DfSQ1SAeEQwYkMrdCEhn/Qpnip3mlyswJsUSAy5r1K
4VuvK5HjJtXAwAMqGrPbq5/53A4A/QgDUArDFPBHHort008HWCJMhjwnJY37WFPzCr6xYNedk
KE2+d8sYLR0EyP4bReGFAo3AuGBH0ljrSNl8N3YIKsEfZm6x7O+MY9C2K7+QEWHWYFK2GY6dJ
DNJ0ZMh7gC6CNFu8BjezR/NWS9cas0EmIeegh0/Bi5rNc/3YHwpCCszFefBjvhv2l33ofNt1P
CcTsnjXclkfpWLDpm
X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,
SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Johannes Schindelin via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Johannes Schindelin <Johannes DOT Schindelin AT gmx DOT de>
Cc: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

Hi,

On Fri, 30 Apr 2021, Kevin Locke wrote:

> On Fri, 2021-04-30 at 23:53 +0900, Takashi Yano wrote:
> > On Fri, 30 Apr 2021 08:25:12 -0600 Kevin Locke wrote:
> >> I'm investigating an issue in Git for Windows[^1], which also affects
> >> Cygwin.  The issue is that, when using CMD (i.e. Command Prompt) on
> >> Windows 10 1703 or above with "Legacy Console Mode"[^2] disabled, if
> >> TERM=cygwin is set in the environment, the console is not cleared when
> >> vi exits.  To demonstrate, with Cygwin 3.2.0, in CMD with "Legacy
> >> Console Mode" disabled:
> >>
> >> cd C:\cygwin64
> >> set TERM=cygwin
> >> bin\vi etc\bash.bashrc
> >> :q
> >>
> >> After exiting vi, the console window has not been cleared and content
> >> from etc\bash.bashrc remains visible, making further use of the console
> >> difficult until cleared.
> >
> > Why on earth do you want to set TERM=cygwin?
> > If you don't set TERM=cygwin, TERM is automatically set to
> > xterm-256color, in which the issue does not occur.

TERM=cygwin would be correct right until the time when you toggle
`ENABLE_VIRTUAL_TERMINAL_PROCESSING` under our feet.

That is, when the Cygwin process is called, this flag is not set, so
`TERM=xterm-256color` would be incorrect. And then when the Cygwin process
returns, the flag is set, and the calling process should somehow guess
that `TERM` should be set differently.

Oh, and you probably expect the caller to then figure out whether the flag
was _actually_ toggled, just in case we're running on a Windows 10 version
that is too old to understand that flag.

If you expect CMD to be no longer used after the Cygwin process returns,
that might be a valid world view. But that is probably not a very tenable
world view.

If Cygwin is unable to handle `TERM=cygwin` correctly when
`ENABLE_VIRTUAL_TERMINAL_PROCESSING` is toggled, then Cygwin should
definitely, absolutely, with 100% certainty _not_ toggle that flag when
`TERM` is already set to `cygwin`!

Ciao,
Johannes

> Unfortunately, I am not clear on that myself.[^6]  According to Johannes
> Schindelin[^7]:
>
> > We specifically set TERM so that Cygwin (or more correctly, the MSYS2 runtime) uses ANSI sequences...
>
> Hopefully he (or another of the Git for Windows contributors) can add
> more specifics.
>
> Thanks,
> Kevin
>
> [^6]: https://github.com/git-for-windows/git/issues/3177#issuecomment-828507812
> [^7]: https://github.com/git-for-windows/git/issues/3177#issuecomment-826834976
>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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