Less.exe colors break after any other output is written #5854

Closed
opened 2026-01-31 00:23:29 +00:00 by claunia · 3 comments
Owner

Originally created by @adam-c-anderson on GitHub (Jan 10, 2020).

Environment

Windows build number: 10.0.18363.0
Windows Terminal version (if applicable): 0.7.3451.0

Any other software? `less` installed from Chocolatey. `choco install less`.

Steps to reproduce

  1. Open a new PS terminal session. I'm able to reproduce this with an empty profile.
  2. View some output from less. less -? is quick and easy but anything will do. Less outputs help with expected normal/foreground color (gray or white)
  3. Do something that causes output. I used ls but type also works. The output appears as normal.
  4. Now view some output from less again. e.g. less -? again

Expected behavior

less normal output should appear as before with a gray/white foreground color

Actual behavior

less normal output uses black as the foreground color, rendering it illegible on dark backgrounds. This only occurs in Windows Terminal. The normal console host does not reproduce this problem.

Originally created by @adam-c-anderson on GitHub (Jan 10, 2020). # Environment ```none Windows build number: 10.0.18363.0 Windows Terminal version (if applicable): 0.7.3451.0 Any other software? `less` installed from Chocolatey. `choco install less`. ``` # Steps to reproduce 1. Open a new PS terminal session. I'm able to reproduce this with an empty profile. 2. View some output from less. `less -?` is quick and easy but anything will do. Less outputs help with expected normal/foreground color (gray or white) 3. Do something that causes output. I used `ls` but `type` also works. The output appears as normal. 4. Now view some output from less again. e.g. `less -?` again # Expected behavior `less` normal output should appear as before with a gray/white foreground color # Actual behavior `less` normal output uses black as the foreground color, rendering it illegible on dark backgrounds. This only occurs in Windows Terminal. The normal console host does not reproduce this problem.
claunia added the Needs-TriageResolution-ExternalNeeds-Tag-FixTracking-External labels 2026-01-31 00:23:29 +00:00
Author
Owner

@lzybkr commented on GitHub (Jan 10, 2020):

I think you're hitting a problem in less.exe which I've fixed. My fix was merged but I don't think it was released yet. You can see the fix and get a pre-built binary here.

@lzybkr commented on GitHub (Jan 10, 2020): I think you're hitting a problem in `less.exe` which I've fixed. My fix was merged but I don't think it was released yet. You can see the fix and get a pre-built binary [here](https://github.com/lzybkr/less/releases/tag/fix_windows_vt).
Author
Owner

@adam-c-anderson commented on GitHub (Jan 10, 2020):

Interesting. FWIW, the less that comes installed with Git for Windows does not seem to exhibit the same problem. I.e.

> & 'C:\Program Files\Git\usr\bin\less.exe' -?
> ls
> & 'C:\Program Files\Git\usr\bin\less.exe' -?

outputs help text with the desired light FG color while the same steps with C:\ProgramData\chocolatey\bin\less.exe outputs with black FG on the second invocation. I hope your fix gets accepted and released soon!

@adam-c-anderson commented on GitHub (Jan 10, 2020): Interesting. FWIW, the `less` that comes installed with Git for Windows does not seem to exhibit the same problem. I.e. ```ps1 > & 'C:\Program Files\Git\usr\bin\less.exe' -? > ls > & 'C:\Program Files\Git\usr\bin\less.exe' -? ``` outputs help text with the desired light FG color while the same steps with `C:\ProgramData\chocolatey\bin\less.exe` outputs with black FG on the second invocation. I hope your fix gets accepted and released soon!
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 13, 2020):

I'm going to close this one out, actually. Further discussion about less, specifically, should be had at https://github.com/gwsw/less/pull/29. Thanks!

@DHowett-MSFT commented on GitHub (Jan 13, 2020): I'm going to close this one out, actually. Further discussion about less, specifically, should be had at https://github.com/gwsw/less/pull/29. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5854