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

Dim escape code in terminal should not effect background color #161316

Closed
willmcgugan opened this issue Sep 20, 2022 · 6 comments · Fixed by #183217
Closed

Dim escape code in terminal should not effect background color #161316

willmcgugan opened this issue Sep 20, 2022 · 6 comments · Fixed by #183217
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Milestone

Comments

@willmcgugan
Copy link

willmcgugan commented Sep 20, 2022

Type: Bug

The dim ansi escape sequence SGR 2 changes both the foreground and background color in the vscode terminal. AFAICT other terminals only alter the text color.

Reproduce with the following python code:

print('\x1b[2;41mHello\x1b[0m\n\x1b[41mHello\x1b[0m\n')

On vscode, the background color of the dim text appears blended with the window color. On other terminals the background red is the same on both lines.

Output on vscode

Screenshot 2022-09-20 at 16 37 10

Output on iTerm for MacOS

Screenshot 2022-09-20 at 16 37 25

BTW I disabled the "minimum contrast ration" setting by setting it to 1.

VS Code version: Code 1.71.2 (74b1f97, 2022-09-14T21:07:15.900Z)
OS version: Darwin arm64 21.6.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 5, 5, 4
Memory (System) 16.00GB (0.27GB free)
Process Argv --crash-reporter-id 708fb231-9126-40c3-a471-56c4901cf66d
Screen Reader no
VM 0%
Extensions (48)
Extension Author (truncated) Version
vscode-sqlite ale 0.14.1
vscode-color ans 0.4.5
vscode-database baj 2.2.3
vscode-django bat 1.10.0
better-toml bun 0.3.2
vscode-svgviewer css 2.0.0
vscode-eslint dba 2.2.6
xml Dot 2.5.1
vsc-material-theme Equ 33.5.0
vsc-material-theme-icons equ 2.4.0
prettier-vscode esb 9.8.0
code-runner for 0.11.8
vscode-pull-request-github Git 0.50.0
sass-lint gle 1.0.7
gc-excelviewer Gra 4.2.55
vscode-peacock joh 4.2.1
chat kar 0.35.0
restructuredtext lex 189.2.0
dotenv mik 1.0.1
theme-monokai-pro-vscode mon 1.1.21
black-formatter ms- 2022.5.12591021
python ms- 2022.14.0
vscode-pylance ms- 2022.9.20
jupyter ms- 2022.8.1002431955
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.9
vsliveshare ms- 1.0.5723
vsliveshare-audio ms- 0.1.91
vsliveshare-pack ms- 0.4.0
color-highlight nau 2.5.0
autodocstring njp 0.6.1
hide-gitignored npx 1.1.0
vetur oct 0.36.0
austin-vscode p40 0.10.8
material-icon-theme PKi 4.20.0
excalidraw-editor pom 3.3.1
vscode-commons red 0.0.6
vscode-yaml red 1.10.1
LiveServer rit 5.7.9
snappify sna 1.0.1
code-spell-checker str 2.8.0
sass-indented syl 1.8.22
cython tcw 0.1.0
simple-rst tro 1.5.2
luna-paint Tyr 0.16.0
vscode-icons vsc 11.17.0
markdown-all-in-one yzh 3.4.3
material-theme zhu 3.15.5

(3 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30557514
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
hb751961:30553087
dsvsc012cf:30540253
azure-dev_surveyone:30548225
i497e931:30553904
fc301958:30567733

@meganrogge
Copy link
Contributor

meganrogge commented Sep 22, 2022

Related to xtermjs/xterm.js#3534

@meganrogge
Copy link
Contributor

meganrogge commented Sep 22, 2022

We changed this to align with xterm and VTE (Gnome terminal / Konsole). While ITerm doesn't do this (yet?), we went with what most terminals do

@meganrogge meganrogge added the *as-designed Described behavior is as designed label Sep 22, 2022
@vscodenpa
Copy link

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2022
@willmcgugan
Copy link
Author

I don't think that's the case. I ran a straw poll on Twitter, and it was a virtual consensus that dim does not change the background color.

https://twitter.com/willmcgugan/status/1572208240493985793

This isn't actually related to xtermjs/xterm.js#3534 The code I pasted above changes background and foreground colors, but doesn't apply the escape code for inverse.

@willmcgugan
Copy link
Author

@meganrogge Could you take another look at this one? I've confirmed that vscode is unique in this behaviour.

Here are screenshots from gnome terminal and xterm:

Screenshot 2022-09-29 at 12 08 13

Screenshot 2022-09-29 at 12 06 27

@Tyriar
Copy link
Member

Tyriar commented Sep 29, 2022

Yeah looks like a problem, thanks

@Tyriar Tyriar reopened this Sep 29, 2022
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream and removed *as-designed Described behavior is as designed labels Sep 29, 2022
@meganrogge meganrogge added this to the Backlog milestone Oct 3, 2022
@meganrogge meganrogge removed their assignment Dec 5, 2022
@Tyriar Tyriar modified the milestones: Backlog, January 2023 Dec 8, 2022
@Tyriar Tyriar modified the milestones: January 2023, Backlog Dec 16, 2022
@Tyriar Tyriar added the upstream-issue-fixed The underlying upstream issue has been fixed label May 20, 2023
@Tyriar Tyriar modified the milestones: Backlog, May 2023 May 20, 2023
Tyriar added a commit that referenced this issue May 23, 2023
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label May 23, 2023
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 25, 2023
@alexr00 alexr00 added the verified Verification succeeded label Jun 1, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants