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

PowerShell's limitation on 4bit basic 16 colours #3520

Open
Gregory-K opened this issue Apr 23, 2024 · 0 comments
Open

PowerShell's limitation on 4bit basic 16 colours #3520

Gregory-K opened this issue Apr 23, 2024 · 0 comments

Comments

@Gregory-K
Copy link

Topic

The common case, in which the DarkMagenta (color 5||color 35||BgMagenta||...) cannot be displayed in a PowerShell terminal.
It can be immediately observed in the 'Commits' panel (head, branch name) and the missing 'Donate' link (the later may be not 'observed' at all, if one uses only PowerShell. It's just non-existed unless one choses to click on the empty space where 'Donate' should be displayed).

The problem is not specifically tied to the 'DarkMagenta' colour. Any of the 16 basic colours, depending on the theme chosen, could become essentially 'transparent'. But, the 'DarkMagenta' is the most possible scenario, as the default PowerShell theme has chosen it to represent the terminal background.

My thoughts - Elaborate

The reason behind this is that PowerShell does not have a separate colour for the terminal background. User chooses one from the 4bit defaults.

Checking the 'Use Separate Background' in PowerShell terminal settings does not offer a sustainable solution.

Further into the subject > https://devblogs.microsoft.com/commandline/new-experimental-console-features/#looking-back-moving-forward

A key difference between Windows Console and NIX-based VT Terminals is that UNIX Terminals have a notion of default foreground and background colors, which are independent from the Terminal’s color palette. The Windows Console does not … at least not quite the same!

Alas, because Windows Console has no API to discover what the “default background color” is, PowerShell assumes that the background is the color defined by color #0 … which usually IS the background color … except in PowerShell which uses color #5

Alas, the changes we’re working on (and exposing via the experimental Terminal settings page) won’t fix this specific issue for Windows PowerShell ☹

A possible Resolution

  • Provide the configuration option for User to define values for the basic colours.
  • Provide the configuration option for User to define colour values for all the UI elements ('Commits' panel branch name, hyperlinks, etc.)

I dedicated a meaningful amount of time to search for an already existing solution (config.yml, possible existing 'issues'). I will be willingly stand corrected, if I've overlooked an existing work-around.


P.S. Firstly, kudos for 'lazygit'. It's one of the best TUIs for git. On the matter, I know that the PowerShell terminal is not a first class citizen nowadays, therefore, I started this issue as a discussion note on a possible problem (at least for people that don't want to use the new 'Windows Terminal'). I'm leaving it at your discretion to re-assign labels or delete it completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant