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

What should $env:TERM be for the new Windows console? #12174

Closed
rkitover opened this issue Jan 15, 2022 · 2 comments
Closed

What should $env:TERM be for the new Windows console? #12174

rkitover opened this issue Jan 15, 2022 · 2 comments
Labels
Area-VT Virtual Terminal sequence support Issue-Question For questions or discussion 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 Resolution-Answered Related to questions that have been answered

Comments

@rkitover
Copy link
Contributor

Is there any standard for what $env:TERM should be for native Windows console apps supporting the new console capabilities?

For Neovim, I discovered that setting:

$env:TERM = 'vtpcon'

or leaving it unset enables support for the new console.

Setting:

$env:TERM = 'xterm-truecolor'

also seems to work correctly, and supports 24 bit color.

@rkitover rkitover added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jan 15, 2022
@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 Jan 15, 2022
@rkitover
Copy link
Contributor Author

rkitover commented Jan 17, 2022

I settled on this solution for now, and it seems work well with everything:

$env:TERM = 'xterm-256color'
$env:COLORTERM = 'truecolor'

, as far as I know this is very commonly used on Linux as well.

The advantage is that the vast majority of terminfo databases and builtin terminal libraries recognize xterm-256color, it's been around for quite a while, and such programs often have truecolor support as well. Sometimes some minor tweaks are needed for this, like the $env:COLORTERM variable which is not necessary in my case, or minor adjustments to the terminal definition like here:

tmux/tmux#1246 (comment)

. If there are terminal sequences and features this configuration does not support, we should define an $env:TERM name and put it in the ncurses package, which is where most systems get their terminfo database.

Related:

git-for-windows/git#3629
neovim/neovim#17021

@zadjii-msft
Copy link
Member

Yea, that's what I'd broadcast us as. I know we're not technically 100% compliant with xterm-256color, but that seems to offer the broadest support. If we're not living up to xterm-256color, then that's a bug for us to fix.

There's also other discussion in #1040, #11057, #8303, #2958. Note that I'd not recommend ms-terminal - that's not maintained by us, nor would I expect it to be available on many distros, or kept reasonably up to date.

@zadjii-msft zadjii-msft added Area-VT Virtual Terminal sequence support Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Issue-Question For questions or discussion 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 Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

2 participants