X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B659F3850434
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=pdinc.us
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jpyeron@pdinc.us
DKIM-Filter: OpenDKIM Filter v2.11.0 mail1.pdinc.us 107HsN9P004383
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdinc.us; s=default;
 t=1610042064; bh=yQ6x+RA4j/ttv848wjLnVw5AYiBmBwuH2CRiLcFOxGQ=;
 h=From:To:References:In-Reply-To:Subject:Date:From;
 b=Y5zj9OPVnzaH8AHZ59cea8z1RFb1zpBHn7ecJuG5N6mSNFd14o07P5ZWfjyQsT6UP
 5cdi/BoE6QBdR/W6TVBO8vok62aGurtP3vEzG+xhF9D53G3yYeJJ6Xp3wME653tZqy
 AhyQbvY9KjybvgDaieOIbntc2nydPUiLjBirZguZlEOTXfZgYuscyoO2UA4foZVIni
 VqnIXp9/fWRyT3KArdvNOtRL1gEutzyjyO6fCWEpBiTpwS+QekqLr3tb/dNPm7m4pV
 yfHf/+Q1wXvITvqXgrm6FwYCmWz6+8d2LIEKevuUaObNfvo1OV/EBEgt0hAWoSDSyf
 X7xLjFICYLwUg==
From: "Jason Pyeron" <jpyeron@pdinc.us>
To: <cygwin@cygwin.com>
References: <CAPjM6w-mPf5h=xR2MK-cu-Eb7g313A3cZBcOuQ=ygTL2_dOmFw@mail.gmail.com>
 <20201229223820.7a010585bbfd0973faf618ae@nifty.ne.jp>
 <c8ad9cbf914e4594bc8ba9c15e61e882@BELBRU-EXMP101.eeas.europa.eu>
 <20210106103602.75dae17f4921bd624e09683a@nifty.ne.jp>
 <20210106185206.25036de8b4aa93cc19af6dd0@nifty.ne.jp>
 <77c04a8932e54806900cb88c6169c7da@BELBRU-EXMP101.eeas.europa.eu>
 <20210107180502.28f1939a4309cb8c4a1d92a4@nifty.ne.jp>
 <76b224dfb8444d2a94e30a1762356001@BELBRU-EXMP101.eeas.europa.eu>
 <021001d6e502$e9d9f900$bd8deb00$@pdinc.us>
 <20210108000012.6688977e8dbab46720d74426@nifty.ne.jp>
 <96f5e43a-38e8-d1d7-0ea7-e9aedb9a6e8a@SystematicSw.ab.ca>
In-Reply-To: <96f5e43a-38e8-d1d7-0ea7-e9aedb9a6e8a@SystematicSw.ab.ca>
Subject: RE: [cygwin] jansi adds spaces to output running maven on java in w10
Date: Thu, 7 Jan 2021 12:54:34 -0500
Organization: PD Inc
Message-ID: <07d101d6e51e$28b309d0$7a191d70$@pdinc.us>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQHnYVHroTOKJGzqZS927dQtZ20pswK3zPnXAesuDowCREbgpgLnoxH2AYHXGXkCGSe55AHguLmUAd/2O0UBfkXVWgJ1wd83qVKDoqA=
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_INFOUSMEBIZ, KAM_NUMSUBJECT,
 SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

> -----Original Message-----
> From: Brian Inglis
> Sent: Thursday, January 7, 2021 11:49 AM
> 
> 
> On 2021-01-07 08:00, Takashi Yano via Cygwin wrote:
> > On Thu, 7 Jan 2021 09:39:32 -0500
> > "Jason Pyeron" wrote:
> >> I am still curious as to what is the reason that unsetting PWD or setting
> >> TERM=cygwin fixes this.
> >
> > Please refer to https://github.com/fusesource/jansi/issues/165
> 
> ...where the patch attempts to improve how jansi attempts to determine it is
> running under a JVM running in a Cygwin, Msys, or Mingw terminal by looking at
> env var existence and/or contents: they could be set for the user and unrelated.

+import static org.fusesource.jansi.internal.Kernel32.GetConsoleMode;

...

     static final boolean IS_CYGWIN = IS_WINDOWS
             && System.getenv("PWD") != null
             && System.getenv("PWD").startsWith("/")
-            && !"cygwin".equals(System.getenv("TERM"));
+            && GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode) == 0;

Very interesting... unsetting PWD ensures Maven will be blissfully unaware of Cygwin regardless of their patch and setting TERM=cygwin is ignored after the patch.

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