Conemu: Support for Windows 10 bash 24 true color

Created on 18 Oct 2016  Â·  17Comments  Â·  Source: Maximus5/ConEmu

Here's the announcement: https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/

I tested it and the colors really work in bash.exe opened in cmd.exe.

However no matter what I tweak in ConEmu I can't get it to work. I'm guessing it's to do with how ConEmu wraps the real command line?

Other ref: https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13350690-256-color-support

Most helpful comment

I'm aware of it.
When I finish with stable (severel TODO in my list) I plan to refactor the console server.
It's a pain for me (as developer) because I have to sync in realtime conhost contents and true-color attributes.

All 17 comments

@Maximus5 _"RTFM"_ cool down, man! I have looked over the colors docs and there is _no mention of that_. Sorry but Google didn't help me find the page you referenced.

I will try what you suggest and close the issue if it works.

BashForWindows is so special that it _has its own page_ in the documentation. Easy to find.
I spent a lot of time writing them and it's unpleasant to see that users do not look at it.
Instead of sarcasm it would be much better to suggest improvements to docs. The link exists on every page.

@Maximus5 Wait. What sarcasm? I was surprised by your reply. I get it that you spend time but "Easy to find" is relative. Don't just throw _"RTFM"_. I didn't found that page. That's it.

And I need to test whether it works. Right? May be it's some kind of other issue. It's most possible it's this but hey, let's try it first.

The link to "Bash on windows" on color documentation page is referencing "arrows". Sorry but I haven't seen the relevance between arrows and colors.

I like ConEmu because I don't need to be console terminal expert to have good terminal experience. I am grateful for the link. I will have a look, but that's nasty reply.

So:

  1. What sarcasm?
  2. What suggestion other than explicitly define link between color documentation and bash on windows specifics related to color?

Sorry but I don't see my fault here.

OK. Consider this as translation problem of non-native speaker. Sorry for misunderstanding.

I followed the docs and it's generally working but it's buggy. If I for example open vim and then close it, the colors in the console are not 24 bit anymore. Am I missing something?

No, you don't. As docs state, true-color support is limited yet.

Alright. At least I'm doing it right.

I'm noticing bugs to do with arrow navigation (left/right) - sometimes when I start a console, arrows are not working. As far as I can see the solution in the docs is to run bash directly but if I run it directly i will not get 24 bit color right?

sometimes when I start a console, arrows are not working

What do you do?

Anyway, the solution you mentioned just tries to force proper mode, which user may turn on manually any time. This also described in docs

Alternatively, you may enable StatusBar column ‘Terminal modes’. LeftClick the column and select ‘XTerm’ and ‘AppKeys’ when tab with Bash on Windows is active.

Default {bash} task doesn't uses wslbridge because it is third-party product.

I have a default task for new console with the command:

C:\apps\wsl.cmd  "-new_console:C:%LOCALAPPDATA%\lxss\bash.ico" "new_console:D:C:\apps" -cur_console:np

And the contents of wsl.cmd:

call SetEscChar
echo %ESC%[9999H
C:\apps\conemu-cyg-32.exe C:\apps\wslbridge.exe -t

Alternatively, you may enable StatusBar column ‘Terminal modes’. LeftClick the column and select ‘XTerm’ and ‘AppKeys’ when tab with Bash on Windows is active.

Can I force Xterm mode?

By which I mean: is there a way to force xterm mode and disable autodetection because currently it tries to autodetect and sets it to WAC even if I'm passing new_console:p5 or cur_console:p5

Ok, I drilled down to using this:

Default task for new console with the command:

C:\apps\wsl.cmd  

And the contents of wsl.cmd:

@echo off
call SetEscChar
echo %ESC%[9999H
C:\apps\conemu-cyg-32.exe C:\apps\wslbridge.exe -t -cur_console:p5 -cur_console:d:C:\projects

Arrows work! I think this should be in the docs.

Now I'm trying to figure out a way to avoid having a separate file. Can I do the "call SetEscChar echo %..." magic inline in ConEmu Task settings?

Another issue (kind of fatal) - every time I resize conemu window the 24 bit colors stop working. Any fix for this?

@Maximus5 the man pain-point with this experimental color support is the window resizing:

ezgif-496486903

I'm aware of it.
When I finish with stable (severel TODO in my list) I plan to refactor the console server.
It's a pain for me (as developer) because I have to sync in realtime conhost contents and true-color attributes.

To start a terminal with 24-bit colour, without any external scripts as @antitoxic was trying to do, create a task with the following command:

echo  & set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt -new_console:h9999

Where the  is the ESC character that you can copy from SetEscChar.cmd

@Maximus5 would you mind explaining what this magic echo  does? It's obviously related to buffer size we set with -new_console:h9999, but I don't understand what it does. Thanks!

As docs explains, current ConEmu build limits true-color support to the bottom of the buffer.
The 9999 was written at the moment when ConEmu default backscroll buffer height was 9999 lines. So in fact the number should be the same as the long buffer height defined in your ConEmu settings.

Was this page helpful?
0 / 5 - 0 ratings