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

Allow terminal color setting #81

Closed
bitcrazed opened this issue Feb 16, 2018 · 25 comments
Closed

Allow terminal color setting #81

bitcrazed opened this issue Feb 16, 2018 · 25 comments
Assignees
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Product-Conhost For issues in the Console codebase Resolution-Answered Related to questions that have been answered

Comments

@bitcrazed
Copy link
Contributor

From @bbulkow on October 7, 2017 19:13

Windows version: Microsoft Windows [Version 10.0.15063]

Please just add the ability to change colors. Or change the "dark blue on black" to just about anything else, like light blue on black, or dark blue on grey.

If I SSH into another host, the color for directory is dark blue on black. Whoever chose this is a masochist. The default should be something more sensible than dark blue on black - ANYTHING - and the ability to change the color is necessary.

Steps to reproduce: ssh pi@[any host]
$ ls /

You will see that the directory names are unreadable - dark blue on black.

People are asking for mouse and network and all kinds of things. Nonsense. Just allow me to ssh into another host and do an LS and read the output. SSH is the one feature I use most. And please don't tell me to use a windows ssh client like putty. The point of WSL is to give me the workflow I'm used to - and I just ssh around to hosts.

To ask me to change the colors on every host I log into is non-sense.

Copied from original issue: microsoft/WSL#2550

@bitcrazed
Copy link
Contributor Author

From @line117 on October 7, 2017 22:35

https://www.youtube.com/watch?v=K7Vafhl7P0M

UPD: or https://conemu.github.io/

@bitcrazed
Copy link
Contributor Author

From @zadjii-msft on October 9, 2017 17:40

So, there are actually a lot of options available for changing your colors:

  1. You can change your default colors to something more pleasing. You can use colortool to change your defaults, and that should apply to your bash.exe/wsl.exe/ubuntu/suse/etc windows, assuming you haven't otherwise set any properties for them. This is the preferred method, because it's a lot easier to load entire color schemes with colortool than doing it manually.

For ex, colortool -d solarized_dark will give future console launches the "Solarized" color scheme.
image

  1. You can change the properties of your bash.exe window manually.
  • right click ion the title bar of your console window, and click on properties:
    image
  • Use the "Colors" tab to change the values of the color table to something more pleasing.
    image
  • Hit okay to save and apply the changes.
    Note that the Colors dialog is pretty much garbage and is really hard to use, hence colortool.

Also note that unfortunately, colortool doesn't work with WSL and interop. It's a limitation of interop at the moment, but if anyone can find a way around that, PR's are welcome :)

We've also updated the default color scheme as of the Fall Creator's Update, so if you choose to not change any properties at all right now, then when you get updated to FCU you'll get the new colors automatically.

@bitcrazed
Copy link
Contributor Author

From @bbulkow on October 9, 2017 17:50

Thanks for the quick response.

Can you answer the simple question of whether colortool and similar will apply to ssh sessions?

Lots of previous ideas ( like changing LS_COLORS ) doesn't work when you SSH to another machine.

@bitcrazed
Copy link
Contributor Author

From @zadjii-msft on October 9, 2017 17:55

Yes, it should. The actual colors that are displayed are controlled by the client terminal (in this case, conhost.exe), not the server (whatever's on the other end of ssh). So whenever an application on the server side writes text in "blue", it's up to the client to decide with which actual color "blue" is rendered in.

@bitcrazed
Copy link
Contributor Author

From @PhMajerus on October 24, 2017 2:15

Just in case you're feeling adventurous...
I think you could have the colors set on the server if you wanted to.
What you need is an utility between your SSH server and the shell and apps that parses the VT sequences and convert all palette-specific sequences (colors, bright, ...) to RGB (in \e[38;5;r;g;bm style) according to a locally set palette.
This would increase the network traffic a bit, but would enable you to set your colors on the server side, regardless of client.

You can test this out by running the following:
bash 1> >(lolcat)
Colors should be set randomly by lolcat. Server-side palette utility would work in a similar fashion but swapping colors sequences on the fly.

@zadjii-msft zadjii-msft added Product-Conhost For issues in the Console codebase and removed console labels May 21, 2018
@andybak
Copy link

andybak commented Jun 23, 2018

Defaults matter and the defaults are terrible. The "dark blue on black" is unreadable for me.

@bitcrazed
Copy link
Contributor Author

We agree, which is why we worked with our accessibility team during Creators Update to update the default Console color palette for the first time ever.

If you clean-install Windows 10 Creators Update or later, you'll get the new default color palette.

If you upgrade from a previos Windows version, you'll keep your original defaults including the 0x0000ff deep navy blue on black - there was no way for us to upgrade existing installs to the new palette without potentially borking someone's carefully chosen color settings.

If you did upgrade and want the new color palette, you can do so by opening your Cmd instances (wherever they're pinned, and use the Console ColorTool to change your Consoles' palette to the new default, or any other you choose.

@pckilgore
Copy link

Not sure why this was moved from WSL, or why it was closed, because colortool does nothing to change the color scheme of my WSL console (on 17692). Colortool works as expected with cmd consoles.

There is a workaround: Open a cmd terminal then launch wsl from that terminal.

@bitcrazed
Copy link
Contributor Author

This issue was moved to Console because color text rendering is primarily a Console issue, not WSL.

If a Linux application emits VT instructions that say "draw this text in Console's color palette index 1", the terminal draws the text in whatever it has configured in its current color palette.

If your Console's palette says the color at index 1 is 0x0000ff, then it'll be displayed in (the original) deep navy blue ... on black which is horrible on LCD screens ... which is why we updated the default palette for new Win10 installs).

If, on the other hand, your Console's color palette says the color at index 1 is 0x0037DA, then you'll see our new, updated blue ...
image

...which is MUCH more readable on LCD screens:
image

If you choose to set a different color at index 1, then you'll see whatever color you specify.

HOWEVER, if you use Linux tools that emit VT that says "display this text in 0x445566", then Console renders the text using the requested color - the Console's color palette is ignored if specific RGB colors are specified by the generating app ... which is what you see when you pipe text through lolcat:
image

@DhruvM7
Copy link

DhruvM7 commented Aug 17, 2018

It works as expected in Command Prompt, but using this in PowerShell turns the background pink, so I'm afraid to use it. Will it affect only cmd and wsl, or powershell also?

tempsnip

@bitcrazed
Copy link
Contributor Author

No. This is due to a quirk in the way Windows PowerShell changes PowerShell's default background color index (5) and the color itself (0x012456).

I'm working on some additional themes that will give you sane options for Windows PowerShell. Stay tuned!

@bitcrazed bitcrazed reopened this Aug 17, 2018
@bitcrazed bitcrazed self-assigned this Aug 17, 2018
@sorenwacker
Copy link

sorenwacker commented Oct 9, 2018

Why don't you add these colors in the Properties window? I don't find an option to change specifically the dark blue to something else. Where can I change the color values in the palette? The dark blue is also very bad for VIM. And where do I find bash.exe?

@cpadilla
Copy link

I'd also like to comment on this issue as it seems like it's the closest solution to my use case.

I'm using WSL and I've painstakingly set my colors via the command prompt properties dialog.
image
image

In my linux configurations, I additionally set "color130", which seems to be used by vim for some reason. Unfortunately it looks like the command prompt only supports color0 - color15, so I end up with this ugly brown color for color130.
image

Is there any way to set a color above 15? Possibly through the registry?

You can use this command (in bash) to test the colors in the console:

tput setaf 130 && echo XXX

@DHowett
Copy link
Member

DHowett commented Nov 25, 2018

@cpadilla I think 130 is one of the standard xterm-256color colors:

image

Since they're from a fixed and quasi-standardized palette, I don't believe that any terminal emulator allows you to change them.

@cpadilla
Copy link

cpadilla commented Nov 25, 2018

You definitely can the same way that you usually overwrite any of the other colors in xterm, by changing them in your .Xresources file. This is what a default one looks like I think on WSL. Adding *.color130 changes it as expected on my native linux installation but you can also set it via terminal specific configurations (ie. I change it in my termite config). These defaults seem to be the colors that the windows command prompt sets via it's properties dialog, as seen in my initial comment.

! special
*.foreground:   #b9b9b9
*.background:   #101010
*.cursorColor:  #b9b9b9

! black
*.color0:       #101010
*.color8:       #525252

! red
*.color1:       #7c7c7c
*.color9:       #7c7c7c

! green
*.color2:       #8e8e8e
*.color10:      #8e8e8e

! yellow
*.color3:       #a0a0a0
*.color11:      #a0a0a0

! blue
*.color4:       #686868
*.color12:      #686868

! magenta
*.color5:       #747474
*.color13:      #747474

! cyan
*.color6:       #868686
*.color14:      #868686

! white
*.color7:       #b9b9b9
*.color15:      #f7f7f7

EDIT: This .Xresource file was from my monochrome theme actually, and is not the default, but still my point is the first sixteen colors are the most commonly used ones in a terminal and they seem to be the only ones you can set in windows cmd.

@zadjii-msft
Copy link
Member

@cpadilla First off, your color scheme looks awesome, I'm definitely gonna copy that.

I think you're correct that we don't support setting above index 15 at the moment, but I don't believe there's any reason we couldn't.

I've opened #313 to track that issue.

@zadjii-msft zadjii-msft added Issue-Question For questions or discussion and removed discussion labels Dec 14, 2018
@cellcoresystems
Copy link

cellcoresystems commented Mar 1, 2019

There is apossibility to change the default colors of the console.
Just go to HKEY_CURRENT_USER/Console with regedit
and there you find ColorTable00-15 tweak it to your needs ;)

@cellcoresystems
Copy link

There is apossibility to change the default colors of the console.
Just go to HKEY_CURRENT_USER/Console with regedit
and there you find ColorTable00-15 tweak it to your needs ;)

sorry its not working, it shows but does not affect the bash terminal

@NorbertWasilewski
Copy link

There is apossibility to change the default colors of the console.
Just go to HKEY_CURRENT_USER/Console with regedit
and there you find ColorTable00-15 tweak it to your needs ;)

sorry its not working, it shows but does not affect the bash terminal

It does work. There is a 16 ColorTable* values, each mapped to console color. Comments color is stored in a second value (as you can see in Console Properties, it's a second colorbox). So you just need to replace ColorTable01 with a color value you need.

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Area-Settings Issues related to settings and customizability, for console or terminal Resolution-Answered Related to questions that have been answered labels May 29, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 29, 2019
@miniksa
Copy link
Member

miniksa commented May 29, 2019

This has now turned into something like 5 different complaints, many of which are already solved.

We have color tool, we have registry settings, we added another property sheet to the console so you can adjust the terminal properties, we extended the VT sequences processed to set the color options...

All of these, I think, substantially improve this experience.

If there are further individual issues here, let's open new issues for each individual problem instead of continuing to pile on here.

Thanks.

@miniksa miniksa closed this as completed May 29, 2019
@JoshDesmond
Copy link

JoshDesmond commented Jul 22, 2019

I am still experiencing the single original issue with colors on PowerShell version.

The accepted solution for this issue on this superuser thread is to "consider using a terminal emulator like putty." This issue should be re-opened.

@blixten85
Copy link

Why is there no pre-set themes for cmd.exe?
It's like recreating the wheel all over, per person.

@zadjii-msft
Copy link
Member

@blixten85 Because conhost.exe (the application responsible for the cmd.exe window) is now officially in maintenance mode, and most new UI feature requests are being directed towards the Windows Terminal.

If you'd prefer stay on the vintage console, I'd recommend ColorTool.

@coleman-rik

This comment was marked as abuse.

@zadjii-msft
Copy link
Member

@coleman-rik This thread's like, 5 years old. The Windows Console (conhost.exe) did not have a super intuitive way of changing the colors, sure. The Windows Terminal fares a lot better in that regard. If you've still got issues with the color schemes in the Terminal, well, you've come to the eight repo.

Plus, you've been able to run GUI applications in WSL for some time now. Feel free to go install gnome-terminal or whatever your preferred terminal application is from your package manager.

So there's that.

@microsoft microsoft locked and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Product-Conhost For issues in the Console codebase Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests