-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color output is broken in some combinations on Windows + MSYS2 #657
Comments
Update: I have done some investigation and the issue seems to have been resolved in 2019 but the code has since been refactored so the fix was lost. PR #195 resolved this in 2019 but the code path is no longer in master. What disappeared is the call to The essence of the issue is that in Windows 10 an application need to "opt in" for ansi code support by calling SetConsoleMode() with the ENABLE_VIRTUAL_TERMINAL_PROCESSING bits set. All of this is laid out in detail by a Microsoft employee here: microsoft/terminal#6634 (comment) |
Update 2: You might not want to accept my open PR to fix this issue, as I am attempting to fix the root cause in crossterm over at crossterm-rs/crossterm#666 A work-around for the moment to get lsd colors working on MSYS2 is something like this: alias ls="TERM=dumb lsd" because TERM=dumb short-circuits crossterm's broken terminal check. |
Update 3: crossterm merged a fix for this in crossterm-rs/crossterm@35d58cc When a new release of crossterm is out, we can update the dependency for lsd and this issue should be resolved. |
This issue has been resolved in crossterm 0.24:
https://github.com/crossterm-rs/crossterm/releases/tag/0.24 |
I am guessing #675 is related. |
@meain Yes, that is the same issue for sure. |
@martinlindhe Would you be able to check if #688 fixes the issue? I have bumped the |
lsd --version
: 0.21.0echo $TERM
: xterm-256colorecho $LS_COLORS
:Expected behavior
Seeing colors.
Actual behavior
With windows terminal, launcing bash using msys2:
wezterm, launching zsh using msys2:
See colored prompt and colored cargo output is working. Only "lsd" command output has codes showing
←[38;5;4m←[1m bin←[0m ←[38;5;4m←[1m pkg←[0m
.The same "lsd.exe" correctly shows colors in powershell and cmd.exe, and also when run thru stand-alone msys2.
The text was updated successfully, but these errors were encountered: