ls --color and vim incorrect colors #106

Closed
opened 2026-01-30 21:42:28 +00:00 by claunia · 5 comments
Owner

Originally created by @bitcrazed on GitHub (Feb 16, 2018).

From @nickolasclarke on July 29, 2017 8:20

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.16232.1000]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

when I use ls --colors all subsequent prompts have a highlighted background applied to them when using hyper terminal and vs code terminal. This also happens when I use vim in those terminals.

Hyper:
capture

VS Code:
capture2

vim on the BashOnWindows terminal and in Hyper (same thing happens in vscode):
capture3

  • What's wrong / what should be happening instead:

there should not be a alternative background color applied to all lines, and it should not remain after the the command completes.

I'm honestly at a bit of a loss on how to troubleshoot this. I thought it my be my some things I did with LS_COLORS and .dircolors, but I've backed everything out of those and its still doing this. I dont believe it is an issue with the hyper terminal since I am seeing it from the VS Code terminal as well.

Copied from original issue: Microsoft/WSL#2378

Originally created by @bitcrazed on GitHub (Feb 16, 2018). _From @nickolasclarke on July 29, 2017 8:20_ * Your Windows build number: (Type `ver` at a Windows Command Prompt) Microsoft Windows [Version 10.0.16232.1000] * What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots) when I use `ls --colors` all subsequent prompts have a highlighted background applied to them when using hyper terminal and vs code terminal. This also happens when I use vim in those terminals. Hyper: ![capture](https://user-images.githubusercontent.com/2177320/28743272-b18c023a-7478-11e7-9db4-9c9c165fbf9b.JPG) VS Code: ![capture2](https://user-images.githubusercontent.com/2177320/28743273-b7ef361a-7478-11e7-9787-a913e7e655f5.JPG) vim on the BashOnWindows terminal and in Hyper (same thing happens in vscode): ![capture3](https://user-images.githubusercontent.com/2177320/28743306-7ed8985c-7479-11e7-8c3a-fcfaa9af4eda.JPG) * What's wrong / what should be happening instead: there should not be a alternative background color applied to all lines, and it should not remain after the the command completes. I'm honestly at a bit of a loss on how to troubleshoot this. I thought it my be my some things I did with LS_COLORS and .dircolors, but I've backed everything out of those and its still doing this. I dont believe it is an issue with the hyper terminal since I am seeing it from the VS Code terminal as well. _Copied from original issue: Microsoft/WSL#2378_
claunia added the Product-ConhostIssue-BugArea-VTNeeds-Tag-Fix labels 2026-01-30 21:42:28 +00:00
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @nickolasclarke on July 29, 2017 8:50

update: This also happens if I try to use fish and git

@bitcrazed commented on GitHub (Feb 16, 2018): _From @nickolasclarke on July 29, 2017 8:50_ update: This also happens if I try to use `fish` and `git`
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @zadjii-msft on July 31, 2017 20:53

It's probably an issue with mintty if it's affecting both hyper and vscode. They both mintty to attach to a conhost instance.

I don't believe there's any terminal out there that's figured out a way to get conhost's RGB colors working quite yet. We don't plan on changing the API surface, so they can't query the contents of the buffer to get RGB colors back out, instead we round the color to the nearest color table entry.

As an example, vi in hyper (top) vs vi in gnome-terminal (bottom left), vs vi in conhost (bottom right):

image

@mintty can comment more, I don't know too much about the solution space for this issue.

@bitcrazed commented on GitHub (Feb 16, 2018): _From @zadjii-msft on July 31, 2017 20:53_ It's probably an issue with mintty if it's affecting both hyper and vscode. They both mintty to attach to a conhost instance. I don't believe there's any terminal out there that's figured out a way to get conhost's RGB colors working quite yet. We don't plan on changing the API surface, so they can't query the contents of the buffer to get RGB colors back out, instead we round the color to the nearest color table entry. As an example, `vi` in hyper (top) vs `vi` in `gnome-terminal` (bottom left), vs `vi` in conhost (bottom right): ![image](https://user-images.githubusercontent.com/18356694/28797334-d5b85392-75f5-11e7-81e6-7d0132a44c59.png) @mintty can comment more, I don't know too much about the solution space for this issue.
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @mintty on July 31, 2017 22:32

?
Mintty isn't HyperTerminal. What makes you suggest it's involved at all?

@bitcrazed commented on GitHub (Feb 16, 2018): _From @mintty on July 31, 2017 22:32_ ? Mintty isn't HyperTerminal. What makes you suggest it's involved at all?
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @zadjii-msft on July 31, 2017 22:38

@mintty ah you're right, I'm getting my libraries all mixed up. Hyper uses node-pty which is backended on winpty, not mintty. I believe vscode is build atop winpty as well. My mistake.

@bitcrazed commented on GitHub (Feb 16, 2018): _From @zadjii-msft on July 31, 2017 22:38_ @mintty ah you're right, I'm getting my libraries all mixed up. Hyper uses `node-pty` which is backended on *winpty*, not mintty. I believe vscode is build atop [winpty](https://github.com/rprichard/winpty) as well. My mistake.
Author
Owner

@zadjii-msft commented on GitHub (Nov 22, 2021):

You know, this might just be a close-by-design now. The original post might predate us announcing conpty in the first place. Hyper (et al) should be using conpty if they want to act as Terminal emulators. Using the Console API to try and get color and text information out of the buffer simply isn't going to work the way they want.

@zadjii-msft commented on GitHub (Nov 22, 2021): You know, this might just be a close-by-design now. The original post might predate us announcing conpty in the first place. Hyper (et al) should be using conpty if they want to act as Terminal emulators. Using the Console API to try and get color and text information out of the buffer simply isn't going to work the way they want.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#106