Steps to Reproduce:
"terminal.integrated.shell.windows": "\\WINDOWS\\sysnative\\bash.exe"
this is a Linux bash setting, and not vscode/terminal related.
in bash, input:
$ LS_COLORS='ow=01;36;40'
$ export LS_COLORS
this gives you bold (01) cyan (36) dir names with black (40) background
for more info, see for example:
http://askubuntu.com/questions/466198/how-do-i-change-the-color-for-directories-with-ls-in-the-console
hope this helps.
/*Karl
The colors are LS_COLORS
but the color set is defined in vscode.
I think, these are the default colors as defined in dircolors
in bash itself.
when I print out dircolors
in bash directly, I get "ow=34;42
", that is green background (42).
when I change globally the colors in my standalone terminal, vscode does not adopt that, so you are correct....
I am nearly a complete noob in Linux, but wouldn't it be the best to define some 'batch' with LS_Colors
defined and other goodies and run that when you toggle the integrated terminal?
@karlti I'd prefer not to mess with the user's current configuration, rather try tweak the colors so they don't look so bad with the defaults.
To solve this problem simply open the normal bash on ubuntu on Windows then type in order:
1) sudo vim ~/.bashrc
to open the default "setting" of the ubuntu bash.
2) press i
.
3) at the end of the file add this line alias codolor='LS_COLORS="ow=01;36;40" && export LS_COLORS'
4) close the bash and re-open it in Visual Studio Code and then type codolor
.
I solved in this way the problem. Adding this line not change by default the "theme" of the bash, but you can use it only when you are using the bash on ubuntu on Windows in Code.
Ah thanks. That alias worked like a charm. However is there any way to call that alias every start when bash is initialized in vscode?
@jakubsuchybio you can probably just add the script to your ~/.bashrc:
LS_COLORS="ow=01;36;40" && export LS_COLORS
So you just run it without setting up the (manual) alias.
Thanks! I was under impression, that .bashrc was overwritten by vscode somehow. But no, this works.
@jakubsuchybio nope, any commands you want to run on startup just put them in your ~/.bashrc
.
Can I change background color for terminal window only? Thanks.
@bear0330 not currently, these are the relevant issues: https://github.com/Microsoft/vscode/issues/6979, https://github.com/Microsoft/vscode/issues/3112, https://github.com/Microsoft/vscode/issues/13534
Inside visual studio i don't think you can. Using the normal bash you can!
Il 23 Ott 2016 12:16 PM, "Bear Huang" [email protected] ha scritto:
Can I change background color for terminal window only? Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/7556#issuecomment-255580229,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQUK-9j-gZhflppjM-SIL_u9VP8O_-aHks5q2zPrgaJpZM4IzeRX
.
You can also write the above as: export LS_COLORS="ow=01;36;40"
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)
This also fixes the colors for git&others.
where is "ow" referenced? Everything else online says to use "di", but I'm using bash on windows, and I could only change the directory colors using "ow". Now I can't find the parameter that will work to change file colors instead of "fi".
Looks better but still not perfect.
How to code in visual studio code using bash for windows? and also any way to change syntax highlighting for C, C++ in bash for windows?
@SoumyaChatterjee config instructions: https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration
Read about bash on windows and/or vim if that's what you're using to change highlighting.
Just in Vim, you can:
: set background=dark
or put it in your .vimrc
set background=dark
This make the syntax highlighting in Vim look a lot better.
I just created a REG file to set the default console colors to be the same as the default XTerm colors:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
; 00BBGGRR, not RGB!
"ColorTable00"=dword:00000000 ; 0 - black
"ColorTable04"=dword:000000CD ; 1 - dark red
"ColorTable02"=dword:0000CD00 ; 2 - dark green
"ColorTable06"=dword:0000CDCD ; 3 - dark yellow
"ColorTable01"=dword:00EE0000 ; 4 - dark blue
"ColorTable05"=dword:00CD00CD ; 5 - dark magenta
"ColorTable03"=dword:00CDCD00 ; 6 - dark cyan
"ColorTable07"=dword:00E5E5E5 ; 7 - light gray
"ColorTable08"=dword:007F7F7F ; 8 - dark gray
"ColorTable12"=dword:000000FF ; 9 - red
"ColorTable10"=dword:0000FF00 ; 10 - green
"ColorTable14"=dword:0000FFFF ; 11 - yellow
"ColorTable09"=dword:00FF5C5C ; 12 - blue
"ColorTable13"=dword:00FF00FF ; 13 - magenta
"ColorTable11"=dword:00FFFF00 ; 14 - cyan
"ColorTable15"=dword:00ffffff ; 15 - white
If you want to edit it, notice that the numbering of entries (ColorTableXX) and the ordering of RGB values is a bit wacky. Here is what it looks like with the colortest-16
utility:
This should be enough to get most Linux utilities to look OK.
Please note that if you're launching your windows from a link, such as a program pinned to the taskbar, you may have to recreate the link (or unpin the program, close it, and pin it back) in order to use the updated color scheme.
I'm not sure Microsoft would want to use this as the default color scheme for all console windows, because many tools expect the colors to be those of VGA DOS. But if you use Linux tools more than DOS ones (if at all) then you might want to use something like this.
@tobia Thank you very much!
From Understanding Windows Console Settings, you should be able to set the registry key per Console so that Bash, PowerShell, and CMD all get their own defaults.
- Per-Console-application registry settings, stored as sub-keys of ‘HKCU\Console\
’ using one of two sub-key names:
- Console application path (replacing ‘\’ with ‘_’)
- Console title
[HKEY_CURRENT_USER\Console\%SystemRoot%_System32_bash.exe]
@dragonwolf83 @pabranch That's useful!
In this case, I would recommend reopening this issue and adding either my theme, which I took from Xterm, or a similar theme taken from Ubuntu's default terminal, to the project's installer, so that it becomes the default color scheme for all bash windows.
Too many existing utilities require certain color combinations to be readable, such as light yellow on blue, or light blue on black, to just leave the default color scheme to chance.
@tobia I just created a REG file
Thank you very much! I was trying everything, but nothing worked, all my colors were completely bugged, until I apply your fix!
@bear0330 if you haven't managed to change the background yet, you can do it by right-clicking the Ubuntu icon in the top left corner and choose "Properties":
At the same time change under tab [Options] Command History/Buffer Size to e.g. 500 and then under [Layout], Screen Buffer Size/Height to e.g. 500 to get a scrollable terminal window... :)
Just wanted to add some information on how to customize the look of the Windows files. It seems like fi=XX
and di=XX
doesn't apply to Windows files and directories respectively. But as written above, ow=XX
applies to Windows directories and I've found that I can apply style to normal Windows files with ex=XX
. It's really for executables, but every file in Windows seems to be executable according to Linux. This will though effect Linux files as well and maybe confuse you if you had another color for executables before.
Oh, and here's some "reference" found: http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors
I find it hard to believe this isn't a console issue - if it isn't who/what is to blame? And why isn't this an issue on native Ubuntu?
I seem to have to run the codolor command everytime I open the terminal in VS Code to get the colors set in .bashrc. Is there any way to load them by default?
Had to remove the the alias bit. This works
LS_COLORS="ow=01;36;40" && export LS_COLORS
Most helpful comment
this is a Linux bash setting, and not vscode/terminal related.
in bash, input:
this gives you bold (01) cyan (36) dir names with black (40) background
for more info, see for example:
http://askubuntu.com/questions/466198/how-do-i-change-the-color-for-directories-with-ls-in-the-console
hope this helps.
/*Karl