[cygwin] jansi adds spaces to output running maven on java in w10
Jason Pyeron
jpyeron@pdinc.us
Thu Jan 7 17:54:34 GMT 2021
> -----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.
More information about the Cygwin
mailing list