Calling a Windows program changes terminal character attributes

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling a Windows program changes terminal character attributes

Mark Geisert
This may be a duplicate of an already-reported problem.  I haven't seen one
reported quite this way up to now, though.

I'd long ago modified DIR_COLORS to color-code more kinds of files in 'ls'
displays.  I've noticed for a while (weeks?) that some of the chars visible in a
terminal window are made bold just by launching certain Windows commands.  I
just now stumbled onto a simple test case.

1) Open a Cygwin Terminal window,
2) cd to a directory with lots of different file types,
3) issue an 'ls' command
4) issue the command "cmd -c version"

You should immediately see that some characters in the visible part of the
screen buffer have been converted to bold versions.  Not all of them, though.

This only affects the currently-visible part of the screen buffer.  If you
scroll up, older buffer contents are seen to be unchanged.

I am attaching my DIR_COLORS.local file which is appended to the system's
DIR_COLORS by these commands in my .bashrc:

eval `dircolors -b /etc/DIR_COLORS`
LS_COLORS0=$LS_COLORS
eval `dircolors -b /home/mark/DIR_COLORS.local`
export LS_COLORS="$LS_COLORS0$LS_COLORS"

I'm using a 64-bit Cygwin1.dll built from current git, on Windows
10.0.18363.592.  I've also aliased: ls='ls -AF --color -b -T 0 '.

..mark


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

DIR_COLORS.local (938 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Calling a Windows program changes terminal character attributes

Takashi Yano
On Sat, 15 Feb 2020 23:44:53 -0800
Mark Geisert wrote:

> This may be a duplicate of an already-reported problem.  I haven't seen one
> reported quite this way up to now, though.
>
> I'd long ago modified DIR_COLORS to color-code more kinds of files in 'ls'
> displays.  I've noticed for a while (weeks?) that some of the chars visible in a
> terminal window are made bold just by launching certain Windows commands.  I
> just now stumbled onto a simple test case.
>
> 1) Open a Cygwin Terminal window,
> 2) cd to a directory with lots of different file types,
> 3) issue an 'ls' command
> 4) issue the command "cmd -c version"
>
> You should immediately see that some characters in the visible part of the
> screen buffer have been converted to bold versions.  Not all of them, though.

Thanks for the report.

This is the same issue as that of already reported in:
https://cygwin.com/ml/cygwin/2019-12/msg00149.html
https://cygwin.com/ml/cygwin/2020-02/msg00062.html

I am sorry, but it is difficult to fix right now.

Now, poroposals below is under consideration. If this could be realized,
your problem would be solved.
https://cygwin.com/ml/cygwin/2020-02/msg00065.html
https://cygwin.com/ml/cygwin-patches/2020-q1/msg00151.html

--
Takashi Yano <[hidden email]>

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

Reply | Threaded
Open this post in threaded view
|

Re: Calling a Windows program changes terminal character attributes

Mark Geisert
In reply to this post by Mark Geisert
Thanks Takashi for your reply.  I just wanted to add that setting
CYGWIN=disable_pcon in the environment does not fix this issue.
Please ignore this if that's what's expected.
Cheers,

..mark

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

Reply | Threaded
Open this post in threaded view
|

Re: Calling a Windows program changes terminal character attributes

Takashi Yano
On Sun, 16 Feb 2020 01:31:14 -0800
Mark Geisert wrote:
> Thanks Takashi for your reply.  I just wanted to add that setting
> CYGWIN=disable_pcon in the environment does not fix this issue.
> Please ignore this if that's what's expected.

CYGWIN=disable_pcon is needed to be set before launching mintty.
That is, the setting should be in user environment in system
property in control panel rather than in .bashrc.

--
Takashi Yano <[hidden email]>

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

Reply | Threaded
Open this post in threaded view
|

Re: Calling a Windows program changes terminal character attributes

Lee-83
On 2/16/20, Takashi Yano wrote:
> On Sun, 16 Feb 2020 01:31:14 -0800
> Mark Geisert wrote:
>> Thanks Takashi for your reply.  I just wanted to add that setting
>> CYGWIN=disable_pcon in the environment does not fix this issue.
>> Please ignore this if that's what's expected.
>
> CYGWIN=disable_pcon is needed to be set before launching mintty.
> That is, the setting should be in user environment in system
> property in control panel rather than in .bashrc.

Does setting CYGWIN=disable_pcon do the same thing as adding this to
the registry?
-------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Console]
"VirtualTerminalLevel"=dword:00000001
-------------

The registry fix was the answer I got for my "terminal control chars
broken?" question to the list..

Thanks
Lee

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

Reply | Threaded
Open this post in threaded view
|

Re: Calling a Windows program changes terminal character attributes

Takashi Yano
On Sun, 16 Feb 2020 11:51:27 -0500
Lee wrote:

> On 2/16/20, Takashi Yano wrote:
> > On Sun, 16 Feb 2020 01:31:14 -0800
> > Mark Geisert wrote:
> >> Thanks Takashi for your reply.  I just wanted to add that setting
> >> CYGWIN=disable_pcon in the environment does not fix this issue.
> >> Please ignore this if that's what's expected.
> >
> > CYGWIN=disable_pcon is needed to be set before launching mintty.
> > That is, the setting should be in user environment in system
> > property in control panel rather than in .bashrc.
>
> Does setting CYGWIN=disable_pcon do the same thing as adding this to
> the registry?
> -------------
> Windows Registry Editor Version 5.00
>
> [HKEY_CURRENT_USER\Console]
> "VirtualTerminalLevel"=dword:00000001
> -------------

No. They are very differnt. VirtualTerminalLevel=1 enables ANSI
escape sequence handling in command prompt even without flag
ENABLE_VIRTUAL_TERMINAL_PROCESSING.
CYGWIN=disable_pcon disables pseudo console support in PTY.
PTY is used in mintty, xterm, sshd, etc, but not in command prompt.

--
Takashi Yano <[hidden email]>

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