Enable 256 colour support over SSH #379

Closed
rmorrin opened this Issue Jan 30, 2015 · 25 comments

Comments

Projects
None yet
8 participants
@rmorrin
Contributor

rmorrin commented Jan 30, 2015

I'm not sure if this is Cmder specific, but someone else might have solved this problem already.

When I SSH (using the ssh.exe provided by msysgit), I am seemingly unable to get 256 colour support in the terminal:

cmder

I'm fairly certain it's not a configuration problem, as running the same test-script in putty works without issue:

putty

Is this simply a limitation of the SSH client, or is there some workaround available?

Thanks!

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Feb 9, 2015

Hey,

I'm experiencing exact the same issue. 256 colors are not supported it seems by Cmder. I have a tool to display server information, which makes use of 256 color codes, which works perfectly when using mRemoteNG, Putty or Linux terminals, but not when I'm using Cmder.

This is the tool:
https://github.com/willemdh/generate_motd

It's made for CentOS.

When i SSH to a server with this tool, every 256 color code formed like this \e[38;5;39m does not work and only outputs in grey.

Any advice to enable 256 color support in Cmder is welcome.

Thanks;

Willem

willemdh commented Feb 9, 2015

Hey,

I'm experiencing exact the same issue. 256 colors are not supported it seems by Cmder. I have a tool to display server information, which makes use of 256 color codes, which works perfectly when using mRemoteNG, Putty or Linux terminals, but not when I'm using Cmder.

This is the tool:
https://github.com/willemdh/generate_motd

It's made for CentOS.

When i SSH to a server with this tool, every 256 color code formed like this \e[38;5;39m does not work and only outputs in grey.

Any advice to enable 256 color support in Cmder is welcome.

Thanks;

Willem

@teleivo

This comment has been minimized.

Show comment
Hide comment
@teleivo

teleivo Mar 4, 2015

Hello!

is there somebody who got this working? If so, it would be great if you could share your solution :)

Thanks a lot
ivo

teleivo commented Mar 4, 2015

Hello!

is there somebody who got this working? If so, it would be great if you could share your solution :)

Thanks a lot
ivo

@kthakore

This comment has been minimized.

Show comment
Hide comment
@kthakore

kthakore Jun 21, 2015

I am still having this issue.

I am still having this issue.

@teleivo

This comment has been minimized.

Show comment
Hide comment
@teleivo

teleivo Dec 11, 2015

it would be extremely nice if someone who got this figured would share how he did it. thanks!!

teleivo commented Dec 11, 2015

it would be extremely nice if someone who got this figured would share how he did it. thanks!!

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 11, 2015

I have spent hours looking for a solution but didn't find any.

I have spent hours looking for a solution but didn't find any.

@Stanzilla

This comment has been minimized.

Show comment
Hide comment
@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 11, 2015

Contributor

or you could use a mintty session in the development branch

Contributor

daxgames commented Dec 11, 2015

or you could use a mintty session in the development branch

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 11, 2015

Yes but it would be nice if this became possible someday in Cmder

Yes but it would be nice if this became possible someday in Cmder

@Stanzilla

This comment has been minimized.

Show comment
Hide comment
@Stanzilla

Stanzilla Dec 11, 2015

Member

We just gave you two ways it is possible in Cmder..

Member

Stanzilla commented Dec 11, 2015

We just gave you two ways it is possible in Cmder..

@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 11, 2015

Contributor

Mintty is already a part of cmder in the development branch.

Contributor

daxgames commented Dec 11, 2015

Mintty is already a part of cmder in the development branch.

@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 11, 2015

Contributor

@rmorrin it is not a limitation of ssh, rather it is because the Windows console so I that cmder uses for cmd and PowerShell shells is limited to 16 colors.

As I said in earlier responses the development branch uses a newer Git for Windows that includes the xterm-256 capable mintty. This in itself creates other issues. See development branch readme.md where all of this is explained for more.

Contributor

daxgames commented Dec 11, 2015

@rmorrin it is not a limitation of ssh, rather it is because the Windows console so I that cmder uses for cmd and PowerShell shells is limited to 16 colors.

As I said in earlier responses the development branch uses a newer Git for Windows that includes the xterm-256 capable mintty. This in itself creates other issues. See development branch readme.md where all of this is explained for more.

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 11, 2015

Sorry misread. I thought I got it working but I still get:
image

Sorry misread. I thought I got it working but I still get:
image

@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 11, 2015

Contributor

Output of 'echo $TERM'

Contributor

daxgames commented Dec 11, 2015

Output of 'echo $TERM'

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 11, 2015

➜ generate_motd git:(master) ✗ echo $TERM
cygwin

➜ generate_motd git:(master) ✗ echo $TERM
cygwin

@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 11, 2015

Contributor

At you in a mintty session? If so type 'export TERM=xterm-256color' and try again.

Contributor

daxgames commented Dec 11, 2015

At you in a mintty session? If so type 'export TERM=xterm-256color' and try again.

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 22, 2015

@daxgames Thanks for the suggestion and sry for the late answer. I tried typing 'export TERM=xterm-256color', but it didn't help.
On startup:

echo $TERM
cygwin

After exporting TERM to xterm-256color

export TERM=xterm-256color
echo $TERM
xterm-256color

Let me know if I'm doing something wrong or if you have any more suggestions. When I try the same on Babun (https://github.com/babun/babun) it works with 256 colors. Echo of $TERM on Babun on startup:

echo $TERM
xterm-256color

@daxgames Thanks for the suggestion and sry for the late answer. I tried typing 'export TERM=xterm-256color', but it didn't help.
On startup:

echo $TERM
cygwin

After exporting TERM to xterm-256color

export TERM=xterm-256color
echo $TERM
xterm-256color

Let me know if I'm doing something wrong or if you have any more suggestions. When I try the same on Babun (https://github.com/babun/babun) it works with 256 colors. Echo of $TERM on Babun on startup:

echo $TERM
xterm-256color
@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 22, 2015

Contributor

Then I am guessing you are not in a mintty session in under. What are you choosing from the tasks menu to launch your session. If cmder, powershell, or bash these do not support w56 color. Note mintty sessions are only available in cmder development branch at this time so if you are running released cmder 1.2 you will not find it.

You can add Babun to released cmder tasks and it will use mintty and should work with 256 colors.

Contributor

daxgames commented Dec 22, 2015

Then I am guessing you are not in a mintty session in under. What are you choosing from the tasks menu to launch your session. If cmder, powershell, or bash these do not support w56 color. Note mintty sessions are only available in cmder development branch at this time so if you are running released cmder 1.2 you will not find it.

You can add Babun to released cmder tasks and it will use mintty and should work with 256 colors.

@DanielGGordon

This comment has been minimized.

Show comment
Hide comment
@DanielGGordon

DanielGGordon Dec 22, 2015

Cmder with Babun seems to work pretty well.

Cmder with Babun seems to work pretty well.

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 22, 2015

When I go to setting, then Main, Update, and then click apply & check, I get "Your current ConEmu version is 151210 alpha. How can I find version of Cmder? I downloaded from GitHub, unzipped to 'cmder-development' and I'm running it from there with cmder.bat.
I can see 'mintty' and 'mintty as admin' as a submenu from Bash. But when I open, I get:

The system cannot find the path specified.                                                                     


Current directory:                                                                                             
C:\Users\Willem                                                                                                

Command to be executed:                                                                                        
"C:\WINDOWS\system32\cmd.exe" /C C:\Users\Willem\Dropbox\Utilities\cmder-development\vendor\conemu-maximus5\..\
git-for-windows\usr\bin\mintty.exe /bin/bash -l                                                                


ConEmuC: Root process was alive less than 10 sec, ExitCode=1.                                                  
Press Enter or Esc to close console...                                                                         

When I look for mintty I can't find it "C:\Users\Willem\Dropbox\Utilities\cmder-development\vendor\conemu-maximus5" so I guess I'll have to install it over there? The path is truncated however. I downloaded 1.1.3-cygwin17 Where should I put the mintty.exe?

When I go to setting, then Main, Update, and then click apply & check, I get "Your current ConEmu version is 151210 alpha. How can I find version of Cmder? I downloaded from GitHub, unzipped to 'cmder-development' and I'm running it from there with cmder.bat.
I can see 'mintty' and 'mintty as admin' as a submenu from Bash. But when I open, I get:

The system cannot find the path specified.                                                                     


Current directory:                                                                                             
C:\Users\Willem                                                                                                

Command to be executed:                                                                                        
"C:\WINDOWS\system32\cmd.exe" /C C:\Users\Willem\Dropbox\Utilities\cmder-development\vendor\conemu-maximus5\..\
git-for-windows\usr\bin\mintty.exe /bin/bash -l                                                                


ConEmuC: Root process was alive less than 10 sec, ExitCode=1.                                                  
Press Enter or Esc to close console...                                                                         

When I look for mintty I can't find it "C:\Users\Willem\Dropbox\Utilities\cmder-development\vendor\conemu-maximus5" so I guess I'll have to install it over there? The path is truncated however. I downloaded 1.1.3-cygwin17 Where should I put the mintty.exe?

@willemdh

This comment has been minimized.

Show comment
Hide comment
@willemdh

willemdh Dec 23, 2015

Ok managed to get it working in the dev version with link to Babun which was installed in my homedirectory. Thanks @daxgames @DanielGGordon for the help.

Ok managed to get it working in the dev version with link to Babun which was installed in my homedirectory. Thanks @daxgames @DanielGGordon for the help.

@daxgames

This comment has been minimized.

Show comment
Hide comment
@daxgames

daxgames Dec 23, 2015

Contributor

@willemdh Glad you got it working. When you do an update via the ConEmu GUI you are updating the ConEmu portion of Cmder not the full Cmder package.

The error you posted above looks like you downloaded the Cmder source zip and not a Cmder distribution zip. The difference being the distribution zip includes '[cmder_root]\vendor\conemu-maximus5..\git-for-windows\usr\bin\mintty.exe" plus all the other bits Cmder requires but the source zip does not.

if you open a Powershell prompt outside Cmder and chenge to 'C:\Users\Willem\Dropbox\Utilities\cmder-development\scripts' and type '.\build.ps1 --verbose' it will download all the components missing from the source distribution. This will fix 'mintty' from the Cmder tasks menu throwing the error and you will not need to add Babun to Cmder defeating one of the major features of Cmder, portability.

Contributor

daxgames commented Dec 23, 2015

@willemdh Glad you got it working. When you do an update via the ConEmu GUI you are updating the ConEmu portion of Cmder not the full Cmder package.

The error you posted above looks like you downloaded the Cmder source zip and not a Cmder distribution zip. The difference being the distribution zip includes '[cmder_root]\vendor\conemu-maximus5..\git-for-windows\usr\bin\mintty.exe" plus all the other bits Cmder requires but the source zip does not.

if you open a Powershell prompt outside Cmder and chenge to 'C:\Users\Willem\Dropbox\Utilities\cmder-development\scripts' and type '.\build.ps1 --verbose' it will download all the components missing from the source distribution. This will fix 'mintty' from the Cmder tasks menu throwing the error and you will not need to add Babun to Cmder defeating one of the major features of Cmder, portability.

@DanielGGordon

This comment has been minimized.

Show comment
Hide comment
@DanielGGordon

DanielGGordon Dec 23, 2015

Yea Babun is too large to be portable, but it's a lot smaller and simpler than Cygwin. I like having both Cmder as a portable, and if the machine I have is using Babun, then I can use that with Cmder. I like Zsh a lot, which is not an option with cmd or Git Bash

Yea Babun is too large to be portable, but it's a lot smaller and simpler than Cygwin. I like having both Cmder as a portable, and if the machine I have is using Babun, then I can use that with Cmder. I like Zsh a lot, which is not an option with cmd or Git Bash

@Daniel15

This comment has been minimized.

Show comment
Hide comment
@Daniel15

Daniel15 Apr 26, 2016

I just tried out the msys connector mentioned earlier in this issue (https://conemu.github.io/en/CygwinMsysConnector.html). Using SSH results in what appears to be 16-colour mode:

Without the connector, I get the output as shown by @rmorrin, so the connector is definitely doing something:

I'm using ssh.exe bundled with Git for Windows.

Daniel15 commented Apr 26, 2016

I just tried out the msys connector mentioned earlier in this issue (https://conemu.github.io/en/CygwinMsysConnector.html). Using SSH results in what appears to be 16-colour mode:

Without the connector, I get the output as shown by @rmorrin, so the connector is definitely doing something:

I'm using ssh.exe bundled with Git for Windows.

@Daniel15

This comment has been minimized.

Show comment
Hide comment
@Daniel15

Daniel15 Apr 26, 2016

Ah, I missed this part of the ConEmu docs:

You need to ensure that buffer/scrolling is Off

You need to add -cur_console:h0 to your task to disable buffering/scrolling in order for 256 colours to work. ¯_(ツ)_/¯

Ah, I missed this part of the ConEmu docs:

You need to ensure that buffer/scrolling is Off

You need to add -cur_console:h0 to your task to disable buffering/scrolling in order for 256 colours to work. ¯_(ツ)_/¯

@rmorrin

This comment has been minimized.

Show comment
Hide comment
@rmorrin

rmorrin May 4, 2016

Contributor

@Daniel15 Just to confirm, in your previous screenshots are you using bash (Git for Windows) as your shell?

Contributor

rmorrin commented May 4, 2016

@Daniel15 Just to confirm, in your previous screenshots are you using bash (Git for Windows) as your shell?

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