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

Consider setting TERM to xterm-256color #828

Closed
SteveL-MSFT opened this issue Jul 27, 2017 · 9 comments
Closed

Consider setting TERM to xterm-256color #828

SteveL-MSFT opened this issue Jul 27, 2017 · 9 comments
Assignees
Milestone

Comments

@SteveL-MSFT
Copy link
Member

With the change to set TERM=xterm if TERM is not set, this allows some vt100 codes to work correctly. However, if you ssh into Ubuntu16.04 (for example), you'll notice that the prompt doesn't have color. However if you:

set TERM=xterm-256color
ssh user@computer

The bash prompt has full color as you would expect. Don't know if this setting is only compatible with Win10.

@DarwinJS
Copy link

I could add per-target OS defaults for TERM so that win10 / 2016 gets this, while the others get XTERM. As people test others OSes we could add special defaults for them. Let me know if this is desirable.

@SteveL-MSFT
Copy link
Member Author

@DarwinJS that seems reasonable

@DarwinJS
Copy link

Coded and tested.
I did not test what Nano does with this setting on - but it is getting set since the kernel is > 10.0

FYI, in order to properly get Windows Version from Powershell 2 through Windows 10, the following code appears to be the minimum (and the registry keys are a bit messy as of kernel version 10 and "[environment]::OSVersion.Version" is depreciated):

If ($psversiontable.psversion.major -lt 3)
{
  $OSVersionString = (Get-WMIObject Win32_OperatingSystem).version
}
Else 
{
  $OSVersionString = (Get-CIMInstance Win32_OperatingSystem).version
}

@bagajjal
Copy link
Collaborator

@DarwinJS -Thanks for taking your time and looking into this.

This issue can be fixed in the code level. I will make changes to set the TERM to "xterm-256color".
As of now, windows SSH server doesn't care about the TERM so it is specific to non-windows environment (UNIX). Since we are solving this issue at the code level, I think your setup can ignore this.

@DarwinJS
Copy link

@bagajjal - not sure what you mean?

The installer I maintain also installs just the SSH client utils. In fact, that is the default mode if you don't give it additional switches.

Do you mean that ssh.exe will do it's own defaults if no TERM variable is found?

@bagajjal
Copy link
Collaborator

bagajjal commented Jul 31, 2017

Yes, in the code we check for the TERM environment variable. If it doesn't exists then we set the TERM to xterm-256color.

@DarwinJS
Copy link

Ok cool.
I assume if TERM is set externally it overrides?

@bagajjal
Copy link
Collaborator

If the TERM environment variable is set then the code will not do anything.

If the TERM environment variable is not set then only the code will set the TERM to xterm-256color.

@bagajjal bagajjal added this to the Aug-Mid milestone Aug 1, 2017
@bagajjal
Copy link
Collaborator

bagajjal commented Aug 3, 2017

Fix is available in the Aug-Mid release..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants