bugmake - Bugs: bug #62575, Garbled ANSI color codes in Cygwin...

 
 

bug #62575: Garbled ANSI color codes in Cygwin mintty

Submitter:  Stephan Bergmann <sberg>
Submitted:  Fri 03 Jun 2022 01:24:26 PM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.3 Operating System:  MS Windows
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 03 Jun 2022 04:13:01 PM UTC, comment #4: 

AFAIK, ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported only since Windows 10, so using it unconditionally is out of the question.

Moreover, I don't understand why should Make do anything about that , instead of leaving it to the user to set up the terminal so that escape sequences are automatically handled by the terminal, the same way as this happens on Unix.  Am I missing something?

Eli Zaretskii <eliz>
Group Member
Fri 03 Jun 2022 03:48:44 PM UTC, comment #3: 

Just to clarify: Stephan is running make with the -O option.  It may have escaped your notice Gisle.  Any testing of the problem reported needs to use that option as well, or you won't see the issue I'm sure.

Paul D. Smith <psmith>
Group administrator
Fri 03 Jun 2022 02:44:12 PM UTC, comment #2: 


> sh -c 'clang -fansi-escape-codes -fcolor-diagnostics'


Why this when `clang` is giving nice colours w/o any problems
on Windows anyway?

Please do not add this patch without checking that the
`ENABLE_VIRTUAL_TERMINAL_PROCESSING` works. And it does not work
when "Use legacy console" is in effect. Ref:
https://techcult.com/enable-or-disable-legacy-console-for-command-prompt-and-powershell-in-windows-10/

Gisle Vanem <gvanem>
Fri 03 Jun 2022 01:47:07 PM UTC, comment #1: 

I'll have to let @eliz comment on whether this should be enabled for all Windows builds, or not.

Paul D. Smith <psmith>
Group administrator
Fri 03 Jun 2022 01:24:26 PM UTC, original submission:  

I experienced this with `make` built for native Windows (not Cygwin), and run in Cygwin mintty 3.6.1 on Windows 11:

$ cat Makefile
.PHONY test:
        sh -c 'clang -fansi-escape-codes -fcolor-diagnostics'
$ make -O -j2
sh -c 'clang -fansi-escape-codes -fcolor-diagnostics'
clang: ←[0;1;31merror: ←[0m←[1mno input files←[0m
make: *** [Makefile:2: test] Error 1

where clang's ANSI color-coded "error: no input files" stderr output was not displaying in red and bold, but rather with verbatim "←[0;1;31m".

What would fix it for me (but see my "I don't know if it is appropriate to execute this unconditionally on Windows") is the attached 0001-Enable-ANSI-color-codes-in-pump_from_tmp-on-Windows.patch.

Stephan Bergmann <sberg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eliz (Posted a comment)
  • -email is unavailable- added by gvanem (Posted a comment)
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by sberg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-08 psmith Item GroupNone Enhancement
    2022-06-03 psmith Operating SystemNone MS Windows
    2022-06-03 sberg Attached File- Added 0001-Enable-ANSI-color-codes-in-pump_from_tmp-on-Windows.patch, #53271

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code