-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
no color for bat in ssh from a Windows client. #865
Comments
What's the value of |
|
I suspect that would be the culprit. Try setting Additional question for you: do the decorations (grid, line number, etc.) still print, or is |
Neither Thanks. |
Thanks for checking. Two more things:
|
Thanks for quick response @eth-p .
|
Sorry about the delay, and thanks for waiting. After a little bit of experimentation, I found out how to reproduce this with git-bash. It's a very particular setup that requires you to use git-bash with the default Windows console (and not mintty). To try and figure out what was going on, I printed the ANSI escape sequences generated by bat using
The escape sequence Since that displays the colors correctly, that means that it's not the terminal's fault that we end up with broken colors. To try and pinpoint the cause of the issue, I tried running that executable through the git-bash shell. /c/windows/system32/openssh/ssh.exe [...] And that resulted in the same issue. This suggests that the MSYS2/git-bash/cygwin environment does not support ANSI 256-color escape sequences. To verify that, I ran the git-bash ssh executable (which uses the MSYS2 environment) from cmd:
The exact same result. The common denominator here would be any program that uses the MSYS2 environment. I suspect the MSYS2 environment is parsing the escape sequences and using the legacy Conclusion: Workaround: Solution: |
thanks for the details. |
I haven't tried it, but if I have to take a guess, it's because tmux is a terminal multiplexer. A large part of that requires interpreting escape sequences and emulating a real terminal. Maybe it approximates the 256-color sequences as 16-color sequences as part of the process for rendering the pty's display? Try running this inside tmux: printf "\x1B[38;5;211mTest\n" If it's 256 colors, it should show up as a warm pink. If it's being approximated, it might show up as pure magenta. |
How can we continue here? Is this something that can be fixed in |
That looks a bit like it was changed to red (
The MSYS2 issue isn't really fixable by us, but we could work around the issue by having a simple way to force 16-color output ( |
Thanks. That sounds good to me. I would prefer We would then simply need to change this line: Line 137 in 70480ee
|
Sounds good. We would also need to support 4-bit color (ANSI 16 colors) to fix this issue. Should that be called "4bit" or "ansi"? Does bat currently have a mechanism to convert to 4-bit color, or is it just 256/truecolor right now? |
Oh wait. We already have a way to fix this:
|
Sadly, it still emits 256-color escape sequences (
|
Ok, that actually looks like a bug to me. I have opened #934 to address this. |
Please see the updates in v0.15.1 |
I'm using
C:\Program Files\Git\usr\bin\ssh.exe
to connect to my linux host which hasbat
installed.I have export
COLORTERM=truecolor
, andThe text was updated successfully, but these errors were encountered: