The Wayback Machine - https://web.archive.org/web/20201208145238/https://github.com/sharkdp/bat/issues/1385
Skip to content
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

Wrong colors, lots of `â"` characters on Windows #1385

Open
xobs opened this issue Nov 16, 2020 · 6 comments
Open

Wrong colors, lots of `â"` characters on Windows #1385

xobs opened this issue Nov 16, 2020 · 6 comments

Comments

@xobs
Copy link

@xobs xobs commented Nov 16, 2020

What version of bat are you using?
bat 0.16.0

Describe the bug you encountered:
Output is unreadable, and contains a lot of garbage.

image

What did you expect to happen instead?
Usable output

How did you install bat?
cargo install bat

Terminal: Windows Terminal 1.3.2651.0
Font: CaskaydiaCove NF
Codepage: 437
Shell: PowerShell 7.0.3

Windows Build 2004

@xobs xobs added the bug label Nov 16, 2020
@eth-p
Copy link
Collaborator

@eth-p eth-p commented Nov 16, 2020

Not too sure about the colors yet, but the random characters where the grid separator should be looks like a unicode decoding issue.

A couple questions:

Does your font support unicode characters?

Is your pager less, and if so, what version is it?

Are you using Git Bash/MSYS2/Cygwin, or the native Windows environment?

What happens if you use --paging=never?

@eth-p eth-p added the windows label Nov 16, 2020
@xobs
Copy link
Author

@xobs xobs commented Nov 16, 2020

Yes, my font supports Unicode characters. I'm using Starship and lsd which print out things using Nerd Fonts.

I'm unsure what my pager is. I don't have $env:PAGER set to anything, and I'm not sure that Windows would honor that anyway.

I'm using a native Windows environment, running Powershell 7.0.3. I notice this isn't the latest version, so I'll upgrade to Powershell 7.1.0 to see if that fixes things at all. Edit: Powershell 7.1.0 doesn't change things.

If I use --paging=never it works:

image

@xobs
Copy link
Author

@xobs xobs commented Nov 16, 2020

It appears as though bat has found less.exe version 436 in my path, and is using that. If I remove less, then things look as expected:

image

@xobs
Copy link
Author

@xobs xobs commented Nov 16, 2020

I've removed the MinGW install, since I'm not sure where it came from. As a result, this is no longer an issue for me. You may close this Issue if you feel it is resolved.

However, it may still be considered a problem that the presence of less.exe in the PATH can cause incorrect output, so this perhaps can still be considered an issue.

@sharkdp
Copy link
Owner

@sharkdp sharkdp commented Nov 23, 2020

Thanks for figuring this out and posting the explanation here.

We could test for very old versions of less (11 years old) and potentially skip them or print an error (on Windows). We already check the version of less, so that would be an easy fix.

@xobs
Copy link
Author

@xobs xobs commented Nov 23, 2020

To be fair, this isn't the first time I've been bitten by random things in the PATH on Windows. Strange and bizarre things happen if sh.exe is there and you try to use make, for example.

There appeared to be a check already, but it wasn't getting triggered. I agree that it's a good first issue.

@sharkdp sharkdp added upstream-error and removed bug labels Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.