Issue with inverted colours on terminal using more. #241

Closed
opened 2026-01-30 21:46:37 +00:00 by claunia · 4 comments
Owner

Originally created by @Hyper200 on GitHub (May 4, 2018).

This bug-tracker is monitored by Windows Console development team and other technical types. We like detail!

If you have a feature request, please post to the UserVoice.

Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue.

Please use this form and describe your issue, concisely but precisely, with as much detail as possible

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Version 10.0.16299.309

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
    using ssh to a remote server, running ls -l | more in /var/log/

  • What's wrong / what should be happening instead:
    It should just disable a list of files in this folder but for some reason the terminal goes nuts and shows black texted with a white background as if i have highlighted it (I haven't)

Seems to invert the colours when you get to -- more --
wsl_terminal_issue1
wsl_terminal_issue2

I wouldn't need to use more if i could find a way to scroll the terminal without the mouse!!

Thanks

Originally created by @Hyper200 on GitHub (May 4, 2018). This bug-tracker is monitored by Windows Console development team and other technical types. **We like detail!** If you have a feature request, please post to [the UserVoice](https://wpdev.uservoice.com/forums/266908). > **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible * Your Windows build number: (Type `ver` at a Windows Command Prompt) Version 10.0.16299.309 * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) using ssh to a remote server, running ls -l | more in /var/log/ * What's wrong / what should be happening instead: It should just disable a list of files in this folder but for some reason the terminal goes nuts and shows black texted with a white background as if i have highlighted it (I haven't) Seems to invert the colours when you get to -- more -- ![wsl_terminal_issue1](https://user-images.githubusercontent.com/37409036/39624675-19f1f29a-4f92-11e8-8b23-f9bb0c1a166e.PNG) ![wsl_terminal_issue2](https://user-images.githubusercontent.com/37409036/39624676-1a0a5646-4f92-11e8-954d-835d073fa3e7.PNG) I wouldn't need to use more if i could find a way to scroll the terminal without the mouse!! Thanks
Author
Owner

@j4james commented on GitHub (May 5, 2018):

Is it possible that your ssh session used a "24-bit color" at some point before this happened? Because this sounds exactly like the behaviour reported in issue #78. I can reproduce the same thing in a local session with:

printf "\e[38;5;7m"
ls -la /usr/bin | more

If it's the same bug, then it should hopefully be fixed as soon we receive the Spring 2018 update, which I believe was released a few days ago.

@j4james commented on GitHub (May 5, 2018): Is it possible that your ssh session used a "24-bit color" at some point before this happened? Because this sounds exactly like the behaviour reported in issue #78. I can reproduce the same thing in a local session with: printf "\e[38;5;7m" ls -la /usr/bin | more If it's the same bug, then it should hopefully be fixed as soon we receive the Spring 2018 update, which I believe was released a few days ago.
Author
Owner

@Hyper200 commented on GitHub (May 8, 2018):

Hi @j4james

I suspect it might be the same issue - I can't seem to reproduce it without using the above command.

Can you tell me what printf "\e[38;5;7m" does?

Cheers

Joe.

@Hyper200 commented on GitHub (May 8, 2018): Hi @j4james I suspect it might be the same issue - I can't seem to reproduce it without using the above command. Can you tell me what printf "\e[38;5;7m" does? Cheers Joe.
Author
Owner

@j4james commented on GitHub (May 8, 2018):

@Hyper200 That's just an escape sequence that sets the foreground color to white (the 7 in that sequence is the choice of color). But instead of selecting from the basic 8-color palette, this is one of the extended color commands that selects from a 256-color palette. There is also a command that lets you specify the exact RGB values of the color you want. Either of these extended color commands will trigger a bug in the handling of the inverse attribute, exactly like the problem you reported.

So my guess was you might have run an app beforehand that used one of those commands to set their color scheme. It could even just be a color that was used in the command prompt of the server you were connecting to.

@j4james commented on GitHub (May 8, 2018): @Hyper200 That's just an escape sequence that sets the foreground color to white (the 7 in that sequence is the choice of color). But instead of selecting from the basic 8-color palette, this is one of the extended color commands that selects from a 256-color palette. There is also a command that lets you specify the exact RGB values of the color you want. Either of these extended color commands will trigger a bug in the handling of the inverse attribute, exactly like the problem you reported. So my guess was you might have run an app beforehand that used one of those commands to set their color scheme. It could even just be a color that was used in the command prompt of the server you were connecting to.
Author
Owner

@Hyper200 commented on GitHub (May 10, 2018):

@j4james

Perfect thanks for the info - I guess this can be closed as a duplicate!

@Hyper200 commented on GitHub (May 10, 2018): @j4james Perfect thanks for the info - I guess this can be closed as a duplicate!
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#241