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

Support for Windows 10 bash 24 true color #920

Closed
antitoxic opened this issue Oct 18, 2016 · 17 comments
Closed

Support for Windows 10 bash 24 true color #920

antitoxic opened this issue Oct 18, 2016 · 17 comments

Comments

@antitoxic
Copy link

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

@Maximus5
Copy link
Owner

RTFM, no?

@antitoxic
Copy link
Author

@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.

@Maximus5
Copy link
Owner

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.

@antitoxic
Copy link
Author

antitoxic commented Oct 18, 2016

@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.

@Maximus5
Copy link
Owner

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

@antitoxic
Copy link
Author

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?

@Maximus5
Copy link
Owner

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

@antitoxic
Copy link
Author

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?

@Maximus5
Copy link
Owner

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.

@antitoxic
Copy link
Author

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

@antitoxic
Copy link
Author

antitoxic commented Oct 18, 2016

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

@antitoxic
Copy link
Author

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?

@antitoxic
Copy link
Author

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

@antitoxic
Copy link
Author

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

ezgif-496486903

@Maximus5
Copy link
Owner

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.

@MGtB
Copy link

MGtB commented Sep 2, 2018

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 �[9999H & 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 �[9999H does? It's obviously related to buffer size we set with -new_console:h9999, but I don't understand what it does. Thanks!

@Maximus5
Copy link
Owner

Maximus5 commented Sep 2, 2018

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.

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

3 participants