microsoft / microsoft/terminal

CSI 58 (undercurl color) sequence misbehaves when in "legacy ANSI" format

Open
#17,426 19 comments 0 reactions 0 assignees View on GitHub
Area-VT Issue-Bug Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

N/A

### Windows build number

10.0.22631.0

### Other Software

neovim 0.10.0
zellij 0.40.1
wezterm 20240520-135708-b8f94c47

### Steps to reproduce

More details are described in https://github.com/wez/wezterm/issues/5450

### A short overview

In the wezterm issue mentioned above, I came across conpty handling the CS 58 (undercurl color) ANSI sequence in a way that causes visual bugs for `zellij` users on modern windows terminals.

In short windows implementation seems to only accept the format:

`ESC[58:2::234:105:98m` (colons, iterm-compatible)

While if a proxy like `zellij` emits a more common ANSI form:

`ESC[58;2;234;105;98m` (semicolons)

it leads to the terminal instead changing text background color.

### Expected Behavior

I wanted to discuss a good way forward to fix this between the `zellij` project and the terminal implementations used on Windows. Some thoughts and options:

- Resolve by simply accepting CSI 58 in the more "ANSI-compatible" semicolon form. Reportedly, wezterm on linux doesn't experience this, so it seems reasonable to sync behaviors between platforms.
- If it's infeasible to fix this in WT code, `zellij` behavior can be fixed instead.

### Actual Behavior

N/A

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the CSI 58 behavior described here and in wezterm issue 5450, using the semicolon and colon forms with Windows Terminal, zellij, and the listed software versions. Trace how the terminal interprets each sequence and determine whether the Windows implementation or zellij should change; done means the semicolon form no longer changes the text background unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.