Microsoft Terminal sets TERM=xterm-256color instead of TERM=ms-terminal #12892

Closed
opened 2026-01-31 03:28:12 +00:00 by claunia · 5 comments
Owner

Originally created by @pagerc on GitHub (Mar 7, 2021).

Microsoft Terminal is not XTerm and does not conform with xterm-256color and therefore should not claim conformance to its terminfo capabilities.

Please update the terminfo database (per #8303) with Thomas Dickey to match more closely to Microsoft Terminal as it is today, and change the default TERM value from xterm-256color to ms-terminal.

A possible workaround is to add configuration options so that users can configure their MSTerm profile and specify the TERM variable that will be set instead of using the default xterm-256color.

Originally created by @pagerc on GitHub (Mar 7, 2021). Microsoft Terminal is *not* `XTerm` and does not conform with `xterm-256color` and therefore should not claim conformance to its terminfo capabilities. Please update the terminfo database (per #8303) with Thomas Dickey to match more closely to Microsoft Terminal as it is today, and change the default TERM value from `xterm-256color` to `ms-terminal`. A possible workaround is to add configuration options so that users can configure their MSTerm profile and specify the TERM variable that will be set instead of using the default `xterm-256color`.
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 03:28:12 +00:00
Author
Owner

@pagerc commented on GitHub (Mar 7, 2021):

In a tangentially related issue, setting WSLENV=TERM causes TERM to be undefined in MS Terminal.
In wsltty, a terminal type such as mintty can be set so that it doesn't reuse a broken xterm related hack.

@pagerc commented on GitHub (Mar 7, 2021): In a tangentially related issue, setting `WSLENV=TERM` causes `TERM` to be undefined in MS Terminal. In wsltty, a terminal type such as `mintty` can be set so that it doesn't reuse a broken `xterm` related hack.
Author
Owner

@DHowett commented on GitHub (Mar 7, 2021):

We don’t set TERM, WSL does. Sorry!

@DHowett commented on GitHub (Mar 7, 2021): We don’t set TERM, WSL does. Sorry!
Author
Owner

@pagerc commented on GitHub (Mar 7, 2021):

We don’t set TERM, WSL does. Sorry!

Then that's the bug, that MS Terminal doesn't provide a means of overriding the TERM environment variable at launch time of the chosen shell.

@pagerc commented on GitHub (Mar 7, 2021): > We don’t set TERM, WSL does. Sorry! Then that's the bug, that MS Terminal doesn't provide a means of overriding the TERM environment variable at launch time of the chosen shell.
Author
Owner

@DHowett commented on GitHub (Mar 7, 2021):

Unfortunately, WSL sets that environment variable after it launches. It’s hard to override things that happen after you’ve ceded control :)

@DHowett commented on GitHub (Mar 7, 2021): Unfortunately, WSL sets that environment variable _after_ it launches. It’s hard to override things that happen after you’ve ceded control :)
Author
Owner

@pagerc commented on GitHub (Mar 10, 2021):

Must be a discrepancy in how WSLTTY and MS Terminal launch WSL. I think WSLTTY is using wslbridge2, so that's probably what it's able to have set the environment on the shell before execing it.

@pagerc commented on GitHub (Mar 10, 2021): Must be a discrepancy in how WSLTTY and MS Terminal launch WSL. I think WSLTTY is using wslbridge2, so that's probably what it's able to have set the environment on the shell before execing it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12892