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

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

Closed
pagerc opened this issue Mar 7, 2021 · 5 comments
Closed
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@pagerc
Copy link

pagerc commented 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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 7, 2021
@pagerc
Copy link
Author

pagerc commented 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.

@DHowett
Copy link
Member

DHowett commented Mar 7, 2021

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

@DHowett DHowett closed this as completed Mar 7, 2021
@pagerc
Copy link
Author

pagerc commented 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.

@DHowett
Copy link
Member

DHowett commented 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 :)

@pagerc
Copy link
Author

pagerc commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants