Skip to content

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

@Tyriar

Description

@Tyriar

From @willmcgugan in microsoft/vscode#161316

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 (74b1f979648cc44d385a2286793c226e611f59e7, 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions