Skip to content

Powerline symbols in the terminal get wrong colors #146406

Closed

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: Version: 1.66.0
  • OS Version: macOS Monterey 12.3 (21E230)

Steps to Reproduce:

  1. Use a powerline-friendly prompt with fancy triangles (\ue0b0) in the terminal.
  2. Open the terminal.

Expected

How this should look (before 1.66.0)

image

Actual

image

The triangles got some mixed colors.

Info

  • The prompt works correctly in iTerm, Terminal, etc. (so this is VSCode),
  • This fails in all shells in VSCode: bash, zsh, or fish.
  • This fails with or without customizations to workbench.colorCustomizations like terminal.ansi*.

Activity

  1. yume-chan commented on Mar 31, 2022

    @yume-chan
    Contributor

    "terminal.integrated.minimumContrastRatio": 1

  2. oleq commented on Mar 31, 2022

    @oleq
    Author

    "terminal.integrated.minimumContrastRatio": 1

    Works like a charm, thanks. This could be mentioned in https://code.visualstudio.com/api/references/theme-color, though.

  3. rewrking commented on Mar 31, 2022

    @rewrking

    "terminal.integrated.minimumContrastRatio": 1

    Thanks. Would love to know why this isn't the default.

  4. oleq commented on Mar 31, 2022

    @oleq
    Author

    "terminal.integrated.minimumContrastRatio": 1

    Thanks. Would love to know why this isn't the default.

    WCAG accessibility guidelines. To make colorful terminal applications look at least okayish no matter the user theme. Makes sense. Mentioned in https://code.visualstudio.com/updates/v1_41#_minimum-contrast-ratio.

    I wonder why this affected my setup now since this has been implemented since 1.41 in 2019? What changed in the recent 1.66 update? 🤔

  5. yume-chan commented on Mar 31, 2022

    @yume-chan
    Contributor

    Yes, it was changed in this month #144762 (comment)

  6. rewrking commented on Mar 31, 2022

    @rewrking

    WCAG accessibility guidelines. To make colorful terminal applications look at least okayish no matter the user theme. Makes sense. Mentioned in https://code.visualstudio.com/updates/v1_41#_minimum-contrast-ratio.

    Yeah, but IMO 4.5 shouldn't be the default because suddenly the ansi terminal colors requested aren't the ones requested. It's another layer of confusion on top of something already confusing. This change isn't really a net benefit.

  7. levrik commented on Mar 31, 2022

    @levrik

    I'm also confused why it changes the color of the powerline rectangles? This doesn't seem to be correct or am I missing something here?

    Edit: Ah. Probably because the background is used to fill the rest of the character with the following color, I see.

  8. jaminthorns commented on Mar 31, 2022

    @jaminthorns

    My prompt uses Powerline symbols, so I had this issue after upgrading to 1.66 as well. I think making the terminal accessible by default is a good call, but it also presents a problem for prompts that switch between using the same color for background and foreground to create the illusion of shaped blocks (like Powerline). I'm sure this affects heavily-customized vim and Emacs setups that do similar things, too.

    If a user still wanted to have the contrast ratio functionality, it might be nice to have a setting like terminal.integrated.excludeContrastRatioAdjustment that would be a string of characters to exclude from contrast ratio adjustment.

  9. Tyriar commented on Mar 31, 2022

    @Tyriar
    Contributor

    This feature has been around for a long time but we changed the default in 1.66 as we're trying to make VS Code the most accessible code editor out there. You can see some of the background on the change here: #144411, I know this might cause an inconvenience but the net benefit is quite large:

    • Themes/shells with incompatible colors (Solarized Dark Theme makes certain command line arguments invisible in PowerShell #144411) will no longer be invisible or super low contrast
    • The terminal should be accessible regardless of your shell and operating system - accessibility is very important to our team
    • It's trivial to disable by setting "terminal.integrated.minimumContrastRatio": 1, you could argue that it's hard to discover this but it's equally hard for users where this makes the terminal unusable to discover it for the inverse problem.

    FYI Isidor Nikolic (@isidorn) about feedback

    Works like a charm, thanks. This could be mentioned in https://code.visualstudio.com/api/references/theme-color, though.

    Aleksander Nowodzinski (@oleq) good idea!

    I'm also confused why it changes the color of the powerline rectangles? This doesn't seem to be correct or am I missing something here?

    Levin Rickert (@levrik) yes it's because how powerlines works is a bit of a hack; for the triangle character, it inverts the background/foreground color so the shape on the left is the foreground and the negative space on the right is the background.

    If a user still wanted to have the contrast ratio functionality, it might be nice to have a setting like terminal.integrated.excludeContrastRatioAdjustment that would be a string of characters to exclude from contrast ratio adjustment.

    Jamin Thornsberry (@jaminthorns) I like the idea of excluding at the least the triangle powerline char from minimum contrast ratio 👍, this character will almost always be used to simulate the background color so it's a nice compromise. This also comes with the nice benefit of still retaining min contrast ratio in the prompt when a powerline is used.

  10. added
    bug
    candidate
    on Mar 31, 2022
  11. 24 remaining items

  12. added
    unreleased
    on Apr 20, 2022
  13. added
    insiders-released
    and removed
    unreleased
    on Apr 21, 2022
  14. meganrogge commented on Apr 21, 2022

    @meganrogge
    Collaborator

    to verify:

    • install a powerline font
    • verify that changing the terminal.integrated.minimumContrastRatio does not alter the color of the powerline glyphs for all values of the terminal.integrated.gpuAcceleration setting
  15. JanDeDobbeleer commented on Apr 21, 2022

    @JanDeDobbeleer

    Megan Rogge (@meganrogge) awesome work! I'll validate it in the morning (evening here).

  16. added
    on-release-notes
    on Apr 28, 2022
  17. jstm88 commented on May 3, 2022

    @jstm88

    I have been fighting this issue for a while, and finally (thankfully) came across this thread. I'd just like to share my thoughts.

    An accessibility feature is great, but it should be opt-in. Most people who might use this setting probably have their systems tuned specifically to their liking anyway. What this feature does in its (currently) default state is completely muck around with the way I've painstakingly set up my prompt.

    Don't take this the wrong way, but it's just like Microsoft to think people can't set up their computers the way they want, and decide that they need to try to tweak things to fix what ain't broke. 🤣

  18. Tyriar commented on May 3, 2022

    @Tyriar
    Contributor

    Justin (@jstm88) we obviously value accessibility more that you 🤷

    This issue is closed with a fix that should work for everyone. If the extra contrast still bothers you you can switch it off by tweaking terminal.integrated.minimumContrastRatio, I trust that you can set up your computer the way you want 😉

  19. jstm88 commented on May 4, 2022

    @jstm88

    Justin (@jstm88) we obviously value accessibility more that you 🤷

    This issue is closed with a fix that should work for everyone. If the extra contrast still bothers you you can switch it off by tweaking terminal.integrated.minimumContrastRatio, I trust that you can set up your computer the way you want 😉

    There are two basic types of accessibility that are relevant here:

    1. Designing the parts of the application you control to have good accessibility properties
    2. Options that modify expected behavior

    1 is obviously good, but 2 is a problem if enabled by default. We don't ship computers with high-contrast mode, large type, and text-to-speech enabled by default, do we? It would be silly.

    The way I understand the fix that's been proposed is that it will make an exception for specific fonts, but it will still modify the colors displayed. This is still bad - you're making edge cases that have to be maintained, and you're opening the door for more of those edge cases as people inevitably discover all of the additional places where it breaks.

    I'll further propose that, perhaps, this setting doesn't really make a lot of sense in the context of a terminal. There's a very simple solution that doesn't require these modifications - just add additional themes for the Terminal with an accessible color palette. Simple and it doesn't introduce edge cases.

    I'm glad accessibility is being considered, but I just think this implementation (specifically making it the default) was ill-advised.

  20. Tyriar commented on May 4, 2022

    @Tyriar
    Contributor

    1 is obviously good, but 2 is a problem if enabled by default. We don't ship computers with high-contrast mode, large type, and text-to-speech enabled by default, do we? It would be silly.

    Justin (@jstm88) Yes it would be silly, but this is a special case where we cannot guarantee contrast between the theme and the application/shell running in the terminal and many users would run into contrast issues because of this where characters were invisible. Plus the default isn't "high contrast", it's to shift the colors towards the minimum recommended contrast as recommended by WCAG AA (4.5) which is not particularly high.

    Bottom line is we have requirements we need to meet around accessibility and this is one of those. You could argue this goes above and beyond what is required, but the tradeoff here after the fix is a good and worth it as contrast will be guaranteed regardless of theme, it only modifies the foreground color so shouldn't be particularly noticeable to most users and it can be easily disabled if it's bothersome.

    I'll further propose that, perhaps, this setting doesn't really make a lot of sense in the context of a terminal.

    The feature was inspired by iTerm2, so we're not the only ones that think it's a good idea. The "just change your theme" approach doesn't work for all background/foreground combinations as that's impossible and we also don't have distinct editor/terminal themes (like Atom), so you'd be forcing those users who want reasonable contrast to use the few (and ugly) high contrast themes.

  21. jstm88 commented on May 4, 2022

    @jstm88

    Daniel Imms (@Tyriar) Those are some good points, and I do see where the setting could still make sense even if there was theme support.

    Still, though, if the option is going to be enabled by default, there absolutely needs to be a notification. There's an established UI paradigm for exactly this case - a panel in the corner, informing the user that the option was automatically changed, with a choice to disable it or accept the change. The notification could appear the first time the Terminal feature is used.

  22. Tyriar commented on May 4, 2022

    @Tyriar
    Contributor

    Justin (@jstm88) we've been fighting "notification fatigue" for a long time, adding a notification for such a minor thing would annoy people. Adding notifications to VS Code core are all heavy scrutinized to protect the user experience and keep VS Code feeling "lightweight".

  23. locked and limited conversation to collaborators on Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginsiders-releasedon-release-notesterminal-renderingupstreamupstream-issue-linkedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions