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

bash.exe in conhost should emit TERM=xterm-256color #1446

Closed
fpqc opened this issue Dec 1, 2016 · 9 comments
Closed

bash.exe in conhost should emit TERM=xterm-256color #1446

fpqc opened this issue Dec 1, 2016 · 9 comments

Comments

@fpqc
Copy link

fpqc commented Dec 1, 2016

I was wondering why conhost wasn't rendering my gray statusbar in tmux even though 256color is there. The problem was that the default environment variable for TERM is xterm and not xterm-256color.

I think this is a WSL/init problem since bash.exe passes the default TERM variable to the WSL environment.

There is a workaround available, which is to launch bash.exe with the correct environment variable (in my case to launch tmux with the correct outer environment variable) as follows:

bash.exe -c "TERM=xterm-256color tmux"

but this is less than ideal. The reason this matters is that programs will change what escape sequences they print to the terminal based on the environment's TERM, so it wastes all of the great work done by the console team.

@benhillis
Copy link
Member

benhillis commented Dec 1, 2016

@fpqc - good call, term should probably use TERM=xterm-256color now that color support is in the build. Can you think of any potential negative side-effects of changing this to the default?

@fpqc
Copy link
Author

fpqc commented Dec 1, 2016

@benhillis Nope! Seems good now. I guess I would ask @zadjii-msft or @bitcrazed if they can think of a reason not to do it.

@miniksa
Copy link
Member

miniksa commented Dec 1, 2016

Makes sense to us over in console land. Go for it @benhillis! :)

@benhillis
Copy link
Member

Cool thanks, checking this in now.

(after change top, before bottom)
image

@fpqc
Copy link
Author

fpqc commented Dec 1, 2016

@benhillis Yeah, by the way, if you have tmux-git available, you can drop a line in .tmux.conf to override terminal capabilities and also enable 24-bit color (the problem is that the current terminfo databases haven't standardized the way to show that a terminal emulator is capable).

set-option -ga terminal-overrides ",xterm-256color:Tc"

This has to be done for every 'outer' terminal (including, for example, screen-256color if you like to use nested remote and local instances of tmux):

2016-12-01 2

So that requires in the remote instance:

set-option -ga terminal-overrides ",screen-256color:Tc"

@fpqc
Copy link
Author

fpqc commented Dec 3, 2016

@benhillis By the way, once conhost hits stable territory wrt the new features planned, it should probably emit something like winxterm or something. That way you can provide a custom terminfo to the ncurses maintainer that describes the exact capabilities of the windows console (and emit it as TERM)

@zadjii-msft
Copy link
Member

@fpqc The goal has always to make conhost's capabilities equivalent to those listed in xterm. If there are any major noticeable gaps, please let us (me) know, but I am under the impression that we are very close to a complete xterm implementation.

@fpqc
Copy link
Author

fpqc commented Dec 5, 2016

@zadjii-msft You're going to implement Sixels? xterm has a million insane and crazy VT420 control sequences as well =O! It also has switches to run in compatibility mode with an absolute ton of ancient hardware terminals. It's like 65k lines of code.

It also includes the following warning at the beginning of the sourcecode:

           Abandon All Hope, Ye Who Enter Here

This is undoubtedly the most ugly program in the distribution. It was one of
the first "serious" programs ported, and still has a lot of historical baggage.
Ideally, there would be a general tty widget and then vt102 and tek4014
subwidgets so that they could be used in other programs. We are trying to
clean things up as we go, but there is still a lot of work to do."

@zadjii-msft
Copy link
Member

@fpqc No, I meant that we're trying to emulate what TERM=xterm encapsulates. I realize there's about 1000 different flags and optional modes for xterm, but there's no way in hell to implement all that, so we want to focus on the core.

MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 As mentioned in the comment, Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 As mentioned in the comment, Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 As mentioned in the comment, Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 As mentioned in the comment, Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 As mentioned in the comment, Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 As mentioned in the comment, Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 21, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate
 one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate
 one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Aug 22, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate
 one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Nov 3, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate
 one easily.

Signed-off-by: Mohammad AlSaleh <[email protected]>
MoSal added a commit to rust-alt/term that referenced this issue Nov 3, 2018
 Windows people seem to be fine with this:
 microsoft/WSL#1446

 I still think a precise terminfo file with the list of
 supported sequences documented in the below link would be ideal:
 https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 But I didn't find such a file. And I don't know how to generate
 one easily.

 A copy of xterm-256color terminfo file is included at compile-time.
 I copied it from ncurses 6.1.

 With this commit, term should be on par with ansi_term for Windows 10
 users.

Signed-off-by: Mohammad AlSaleh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants