-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Don't change background color of selected terminal text #200428
Comments
It was actually a pretty big feature to get the behavior working that you're saying you want changed 😅. The overlay option was how it worked before (and actually how it still worked with The powerline specific "problem" is happening due to the fact that powerline is essentially a hack where it alternates between the background color (which changes with selection) and special characters (which changes to ensure minimum contrast ratio). I have considered making it a little nicer, perhaps by just hiding the powerline symbols completely, but its not clear what the right behavior is here. We could quite easily make the above do this: But anything more clever than that may be a little too complex, I'm hesitant to try to track "powerline" state in the cells that simply change their background color. FWIW I also hit this problem, this is what mine looks like: |
I would make the case that if background colors in terminal output are supported then having the terminal ever overwrite those background colors is necessarily a problem. I wouldn't call powerline a hack any more than I would call highlighting directories using a background color a hack. Color conveys information in the same way glyphs do. If I choose to output something in a particular way I don't want that information arbitrarily erased by the terminal. Either the background color is reserved for selection highlighting or it's not. If it's not reserved and users are allowed to choose background colors to convey information, then the terminal does not have the authority to erase that entirely. Munge based on user settings yes, erase no. As far as solutions, I can think of a few possibilities:
|
Thanks for taking the time to put forward the proposals. I'm leaning towards 2 and blending with the selection color @ 50% opacity. Contrast is less of a problem as the foreground changes dynamically due to minimumContrastRatio. Plus we can have some special logic on the powerline glyphs to also be included in the blending, they already do something similar in how they ignore the minimumContrastRatio requirements as they are seen as background by the user. |
This bug has been fixed in the latest release of VS Code Insiders! @akbyrd, you can help us out by commenting If things still don't seem right, please ensure you're on version 3dea5cb of Insiders (today's or later - you can use Happy Coding! |
The behavior on insiders doesn't quite match @Tyriar's WIP screenshot, which matches my desired behavior. In practice powerline background colors are still being overwritten. |
@akbyrd @andreamah can you share your settings file? Still seems to work as expected for me 🤔 |
I'm able to repro in latest insiders (5d34400) with no VS Settings, no pwsh config (except loading oh-my-posh), and default oh-my-posh config. Maybe related to oh-my-posh if you're using a different powerline implementation? pwsh config
|
Type: Bug
Text selection in the terminal seems to render by changing the background color of text. While that seems reasonable on the surface, it does weird things with powerline type features and other highlighting that might be built into the shell. Notice in the second screenshot below that different parts of the powerline are no longer visible nor are the highlights on directories.
Contrast this with Windows Terminal
Perhaps vscode could blend the selection background and foreground colors with the existing colors instead of overwriting them. Or render selection as an overlay.
VS Code version: Code - Insiders 1.86.0-insider (02b9071, 2023-12-08T11:53:10.286Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: