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

Dark blue text on black background unreadable #930

Closed
oliversalzburg opened this issue Aug 18, 2016 · 53 comments
Closed

Dark blue text on black background unreadable #930

oliversalzburg opened this issue Aug 18, 2016 · 53 comments

Comments

@oliversalzburg
Copy link

It seems some output of the bash is usually in dark blue on black background. This is impossible to read.
image

Changing the background color of the window to a different color is pointless, because the blue output actually defines a black background.
image

  • Expected results
    There would either be a default color scheme that makes more sense or the option to change it.
  • Actual results (with terminal output if applicable)
    See above
  • Your Windows build number
    14393.51
@LFBernardo
Copy link

cd ~
vim ~/.bashrc
paste this at bottom of file
LS_COLORS=$LS_COLORS:'di=0;36' ; export LS_COLORS
PS1='[\033[1;36m]\u[\033[1;31m]@[\033[1;32m]\h:[\033[1;35m]\w[\033[1;31m]$[\033[0m] '
save exit
. .bashrc (note the space between the two dots)

image

@ConnorVG
Copy link

ConnorVG commented Aug 18, 2016

Did you restart your console after applying the background colour @oliversalzburg? A full restart of the console is required.

annoyingly

@oliversalzburg
Copy link
Author

@ConnorVG Very interesting. That does change the outcome indeed. However, not fully.
image
blkid.tab still has the wrong background color, but this definitely helps.

I also realized that when you adjust the RGB values for black, that takes effect immediately.

I also now realized something else. It is possible to adjust all colors, it's just cumbersome af. You can click any of the colors on the palette, which selects it as the default background color, then you can adjust that palette index's RGB values and switch the background back to the palette index you had before. Then you repeat that for every single color you want to adjust and hope that you don't kill yourself in the process.

@ConnorVG
Copy link

@oliversalzburg yeah - it's a bit brutal. It took me way too long to achieve this:
image

@oliversalzburg
Copy link
Author

@LFBernardo Those additions to my .bashrc have no effect. Only when I start another bash from bash, then they're applied. No idea why that is.

@oliversalzburg
Copy link
Author

@ConnorVG Looking good. I would assume this information is stored somewhere, but I couldn't find anything in the registry so far. :\

@ericblade
Copy link

ericblade commented Aug 19, 2016

I have to say that the default dark red looks terrible on 3 of my 4 monitors as well, the only one that it looks ok on has really broken color settings anyway.

The dark blue is also a problem in vi .. so maybe remapping the color is the better option :|

oliver: that should take effect after you exit your bash and open a new one .. of course you can just past the command to your bash for it to take effect in the current one

@LFBernardo
Copy link

@oliversalzburg that is very weird, but then again there seems to be subtle difference between the three machines I am running now as well that reach beyond appearance. Copy and paste for example, works on one but not the other two, have to select the Ubuntu icon at the top to do that..... But that is why it isn't a full release yet so that we can help them iron out the bugs. The blue definitely has to go, not just in WSL but also in other versions of linux, it's never properly visible and has been a pain in the butt for many years. I suggest googling LS_COLORS and seeing the other configuration options?

@oliversalzburg
Copy link
Author

@LFBernardo The funny thing is that I have already set LS_COLORS. I'm actually running dircolors, but none of this has any effect unless I start bash again from within the first bash.

@ni554n
Copy link

ni554n commented Aug 25, 2016

@ConnorVG Your console is looking awesome. How do I customize console colors like that?

@rodrymbo
Copy link

rodrymbo commented Aug 25, 2016

@oliversalzburg - How are you starting dircolors or whatever?

The default Bash.exe doesn't do a login shell yet. (It just reads .bashrc.) If you do su - <username> or bash -l (after starting Bash.exe), you'll get both .bashrc and .bash_profile, etc. Maybe that is why you aren't getting the right colors until you start a new bash from within Bash.exe? (My dircolors is in .bashrc at present, but maybe yours is in .bash_profile?)

I definitely agree that the default WSL install should come with default coloring in the Console that is readable, without the user making changes, whether with ls or vim or whatever. On the other hand, maybe it is possible for the user to make changes in Console defaults that then clash with changes made to bash's terminal settings (LS_COLORS, dircolors, whatever.)

@oliversalzburg
Copy link
Author

@rodrymbo I think I reverted most of my initial attempts, but AFAIR, I used /etc/bash.bashrc. But I guess what you're saying is something to take into consideration.

As it always was, using a different console emulator is the way to go as it seems:
image

@rodrymbo
Copy link

@oliversalzburg - may we ask which terminal emulator you selected? Looks like it might be ConEmu.

I mostly just use PuTTY, since I'm used to it.

It'll be good to get the Console working as a terminal emulator for Bash.exe...

@oliversalzburg
Copy link
Author

@rodrymbo Yes, that is ConEmu. Sorry for not mentioning it.

@zadjii-msft
Copy link
Member

First off, this is kind of a dupe of #366, but I'm going to mark that one as a dupe as this one has WAY more discussion.

MSFT:8661767 is our internal number for updating the color palette. I'm not sure if we'll have time to do it in this particular round of updates, but we've definitely got our eye on it. Bother @bitcrazed on twitter (his work handle is @richturn-ms) if you want to see it done sooner :P.

Moreso, which I've definitely mentioned before but bears repeating because it came up on this thread - I'm very aware of how hard it is to work with the colors dialog currently. It's personally high on my list of priorities, but not necessarily so high on our overall priorities.

@laktak
Copy link

laktak commented Nov 18, 2016

One workaround (or the only one that really worked for me) is to install the solarized-dark theme from https://github.com/neilpa/cmd-colors-solarized (close/open the console window to activate)

@Trainmaster
Copy link

@zadjii-msft I can't understand why this has such low priority. After enabling the WSL you just want to work with the bash. If I first have to fiddle around to have a color scheme one can actually work with - that's really bad in terms of usability.

@JimAmuro
Copy link

Since now 24-bit color only works with default shell (without open API), we don't have other choices (like ComEmu), hence I think MS is responsible for the user experience of the default shell, especially the appearance and editing experience (I wish something like Cmder, but maybe that's too much, at least it should be usable).

@aseering
Copy link
Contributor

@Trainmaster -- I agree for what it's worth that this is important. But I can see why it wouldn't be top priority: I personally have no desire to reconfigure the defaults for the Windows console. In fact, I often go out of my way to configure other shells on other platforms to more-closely match what the default Windows shell does, because for my eyes it is more readable. (I didn't start off using this color scheme; I've settled on it after some experimentation.) Perhaps some people on the WSL team happen to have eyes whose color responsiveness is closer to mine than to yours?

@Po-wei
Copy link

Po-wei commented Apr 27, 2017

I have a problem here
I use @LFBernardo 's solution to adjust ls color, and it works pretty well
However, when I use zsh's tab-auto-complete, it turns out the same color as before.
Anyone has idea?

I type cd and hit tab
image

@akorb
Copy link

akorb commented Jul 10, 2017

This is still a problem

@zadjii-msft
Copy link
Member

@akorb Don't you know it. The default palette is just terrible. We've been having a lot of discussions related to this recently. We should have an update for you later this week on this very topic. Stay tuned :)

@evandrocoan
Copy link

evandrocoan commented Jul 17, 2017

I applied this registry entries microsoft/vscode#7556 (comment) from:

  1. Bash for Windows colors are unreadable with default terminal theme vscode#7556 Bash for Windows colors are unreadable with default terminal theme

And fixed my colors problems. They said we need to set the:

default console colors to be the same as the default XTerm colors

@zadjii-msft
Copy link
Member

@evandrocoan I disagree that they need to be the same as xterm's defaults - every terminal in the world has it's own defaults - but it does need improvement.

I may have jumped the gun when I said "this week" - but it will be SoonTM

@zadjii-msft
Copy link
Member

I can finally comment on this!

https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/
image

Should be fixed in 16257

@mhchu
Copy link

mhchu commented Aug 3, 2017

@zadjii-msft It sounds like they aren't updating people who already have Windows 10... so we have to wait to get that new tool they hinted at? Trying to decide to wait or go ahead and change my registry (never to remember to change them back if the tool comes out eventually).

@zadjii-msft
Copy link
Member

@mhchu It's very likely that if you've ever changed your colors before, you will probably not see the change, just from the nature of how console properties are loaded.

You're always free to set the table to whatever you'd like, this is just a new default experience, so hopefully people like myself won't be so frustrated with the defaults.

We should have more news about the tool in the next week, stay tuned.

@erichiller
Copy link

I'm using dircolors just fine in Linux directories, the problem is under /mnt every file is marked EXECUTABLE and every directory as OTHER_WRITEABLE - and I can't seem to filter out the actual executables with *.exe 00;32 or whatever. Shouldn't the individual file types take precedence?

@8ivek
Copy link

8ivek commented Oct 26, 2017

@markeissler : thanks

Following code appended to my .bashrc as per @markeissler worked for me:

LS_COLORS='rs=0:di=1;35:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41
:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arj=01;31:.taz=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=
01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lz=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;3
1:
.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.ace=01;31:.zoo=01;31:.cpio=
01;31:.7z=01;31:.rz=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.x
bm=01;35:
.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;
35:
.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.n
uv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:*
.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;3
6:.flac=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga
=00;36:
.spx=00;36:*.xspf=00;36:';
export LS_COLORS

PS1='\e[37;1m\u@\e[35m\W\e[0m$ ' # this will change your prompt format

@rm-bergmann
Copy link

rm-bergmann commented Jan 10, 2018

I'm using Powershell + ZSH. I have configured powershell so the normal text is bright pink on black background and I changed my LS_COLORS in my .zshrc file to Cyan which is great!

My current config in .zshrc / .bashrc
#Change ls colours
LS_COLORS="ow=01;36;40" && export LS_COLORS

#Make cd use the ls colours
zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}"
autoload -Uz compinit
compinit

However, I still have a problem with dark blue text on black background. I don't think this text is part of LS_COLORS. Anyone know how or where to update those 2 dark blue colours? I have no idea where they come from? Is it something in the windows registry?

powershell

@bitcrazed
Copy link
Contributor

This issue is now closed as it has been fixed in Win10 Fall Creators Update

Please file Console related issues in the Windows Console Issues Repo: https://github.com/microsoft/console/issues

Thanks.

@bitcrazed
Copy link
Contributor

@rm-bergmann If Fall Creators Update (FCU), we updated the Console's default color palette: https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/

Alas, for a variety of reasons, if you've upgraded your machine to FCU from a previous release, you won't see the new default Console color palette unless you use the ColorTool to modify the default Console colors: https://blogs.msdn.microsoft.com/commandline/2017/08/11/introducing-the-windows-console-colortool/

If you've clean-installed FCU, you should see the updated palette being used if you launch a distro from Cmd, from the start menu distro tile, or from a shortcut you pin to your taskbar.

However, if you launch a distro from PowerShell, the Console you're using will have a different palette defined by PowerShell, which still includes the default dark blue == RGB(0, 0, 128) which is very dark.

If you want, you could modify your PowerShell settings to change the dark blue at index #1 (zero-based) to RGB(0, 55, 218) as per the Console's new default:

image

Also, try launching your distro from a cmd Window, or directly from your distro's start menu tile.

@rm-bergmann
Copy link

rm-bergmann commented Jan 10, 2018

Thanks @bitcrazed!

I have the FCU update and I have the new color pallette, which is what I used to make the background black and the screen text pink.

I actually didn't realize that I could change those colors in the pallete inside the 'selected color values' section without selecting the color as the default!

I love the flexibility, and my issue is sorted now.
Thank You

@rfaile313
Copy link

rfaile313 commented Jul 9, 2019

LS_COLORS='rs=0:di=1;35:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41
:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arj=01;31:.taz=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=
01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lz=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;3
1:
.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.ace=01;31:.zoo=01;31:.cpio=
01;31:.7z=01;31:.rz=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.x
bm=01;35:
.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;
35:
.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.n
uv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:*
.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;3
6:.flac=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga
=00;36:
.spx=00;36:*.xspf=00;36:';
export LS_COLORS

PS1='\e[37;1m\u@\e[35m\W\e[0m$ ' # this will change your prompt format

This works. Don't forget to restart the terminal. Thanks @markeissler

@spacemudd
Copy link

spacemudd commented Jul 10, 2019

This works. Don't forget to restart the terminal. Thanks @markeissler

Or you can do source ~/.bashrc to load the settings w/o restart.

@rfaile313
Copy link

Or you can do source ~/.bashrc to load the settings w/o restart.

True true - you can invoke it for the current sesssion. For most folks I'd say a restart is simpler/easier 😄

@kent-hervey
Copy link

I have this problem...but only when in VIM. Any solution for me?

Incredibly, the below has text: #!/bin/sh

In blue on black

image

@LFBernardo
Copy link

LFBernardo commented Aug 25, 2019

I have this problem...but only when in VIM. Any solution for me?

Incredibly, the below has text: #!/bin/sh

In blue on black

image

vim ~/.vimrc
set background=dark
:wq

The above will resolve your issue

@kent-hervey
Copy link

That was helpful. I achieved relief by typing into the particular VIM instance as :set background=dark

image

@kent-hervey
Copy link

kent-hervey commented Aug 25, 2019

However, this is the newly edited .bashrc file:

image

So still not working. I found a page advising to make the change in vimrc, but I don't find that file on my system.

Regardless, you gave me what I needed to solve. Thank you.

@LFBernardo
Copy link

you need to edit the ~/.vimrc file and add set background=dark
image

@kent-hervey
Copy link

Thanks for the response. My messages/attempts yesterday may have been a bit confusing.

Before changing anything else this morning I have this which I think I created yesterday:
image

And the file contents look like this which looks like the image you sent:

image

but when I manually for that file type :set background=dark,

image

then the image changes to more what I am looking for:

image

I must be doing something wrong, but I don't know what.

There is also a vimrc file in /etc/vim which is read only and contains the below, could that be related?

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

image

@LFBernardo
Copy link

in your folder (~) there is a .vimrc file, you will not always have this by default. When you edit it and save it it will become permanent. You must do this as your normal user and not sudo. If you do this in sudo you are exiting your user space. Copy and paste the following line by line into your editor (not the lines with : as they are commands for vim)

vim ~/.vimrc
set background=dark
:wq

and test it

@kent-hervey
Copy link

Thanks. Before I did not have the vim ~/.vimrc as I thought that was a command at the bash level

Now the file in the /home/khervey directory looks like this. I think it is the same as the (~).

image

This seems to match what you sent, but after doing so and navigating over another folder the output still looks like:

image

I don't know what I am doing wrong. For testing I just completely exited Powershell and then opened again with wsl.exe and proceeded to vim to check.

btw, same file after doing a vim command of set background=dark

image

@LFBernardo
Copy link

you added the command to edit with vim into the file that you were editing
image

Vim is the editor that you use to edit the files, please remove that first line and save it. Also I cannot guarantee that any of these settings will work when you activate wsl through powershell.

@kent-hervey
Copy link

That did it..works in command and powershell Somehow I was doing a file in another directory I reached using CD ~/ I thought that was the plan...go there then create/edit the file. Today I used the command vim ~/.vimrc then just edited the file from the directory where I happened to be.

I would rather delete all my messages (I don't want the posterity), but maybe others can learn from your help and my flailing.

@LFBernardo
Copy link

Happy to hear that worked. I would leave the messages, everything is new to someone at some time. The learning aspect is valuable.

@oliversalzburg
Copy link
Author

I don't understand why it is apparently such a massive challenge to come up with a way to produce a usable appearance for a terminal. I reported this 4 years ago and this is what has been achieved in the meanwhile:

image

I'm baffled as to how this is considered shippable, given this is a directory listing of my home directory with default settings.

For anyone coming here, hoping to get some relief, you're going to want to remove all background colors from ls output:

eval "$(dircolors -p | \
    sed 's/ 4[0-9];/ 01;/; s/;4[0-9];/;01;/g; s/;4[0-9] /;01 /' | \
    dircolors /dev/stdin)"

That same garbage output will then look like this:
image

@zadjii-msft
Copy link
Member

That's a totally different bug my dude - see microsoft/terminal#3848 for more details.

@pale2hall
Copy link

@rodrymbo I think I reverted most of my initial attempts, but AFAIR, I used /etc/bash.bashrc. But I guess what you're saying is something to take into consideration.

As it always was, using a different console emulator is the way to go as it seems:
image

No! That's not a solution to the original XY Question!

that being said, I'm going with it. Thank you. ConEmu is beautiful and I think I'll switch.

@zadjii-msft
Copy link
Member

@pale2hall I mean, the Windows Terminal does have support for lots of user-defined color schemes that don't have the same problem as OP. In fact, since 2017 the console hasn't had that problem either. Is there a particular reason you're choosing ConEmu over the Terminal?

@ProfessorGram
Copy link

ProfessorGram commented Jul 24, 2021

In PuTTY, change ANSI BLUE

To get to this setting, click upper left window corner icon of active PuTTY session

-> Change Settings -> Colors -> ANSI Blue

0
187
187

(the above is ANSI Cyan color, much easier to read)

Click on Apply

Don't forget to SAVE these settings in the profile, or they will be lost next time you log in.

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