Can't set different font for the terminal
When I change font via setting menu of Bash on Ubuntu on Windows terminal, it's applied. But close the terminal and relaunch it, then it goes to default font. However in case of background colour setting, it keeps what I set before.
Is ther anyone who went through this situation?
@trainto It seems current build has this problem indeed.
However, you can use some third party tools like ConEmu. The latest version of ConEmu can use bash on Windows out-of-box. And it comes with tons of configurations as you can imagine, fonts and themes setting of course.
I changed yesterday the font of Bash on Ubuntu on Windows to DejaVuSansMono.ttf and today font is still applied. Could it be you changed it while being in an admin bash and now the normal bash doesn't apply the change?
@onomatopellan Whether I change the font in an admin bash or a normal bash, the font falls back to default as long as I open a new bash console.
I changed fonts via: Right click on the title bar -> Properties -> Font.
Correct, I did it same way. It's a clean install too?
@onomatopellan Well, it's not. I upgraded from Windows 10 version 1511.
Maybe that is the reason?
It could. Old CMD version stored changes on registry and they could conflict with the new CMD. You can try to right click title bar -> enable Defaults and try again.
The Ubuntu guy also explained how he had to use regedit to install Ubuntu font in old CMD versions. http://blog.dustinkirkland.com/2016/04/howto-ubuntu-on-windows.html
Well, maybe I know the reason why.
There are two ways to open bash.
- Press Win + R, enter "cmd.exe" then press enter, and enter "bash".
- Click Windows search, enter "bash" and then enter.
Method 1 launches bash within from cmd.exe, while method 2 launches bash.exe directly( Correct me if I am wrong ). You can set fonts in both methods, but method 1 keeps your setting and method 2 loses.
So it seems method 1 sets fonts for cmd.exe while method 2 sets fonts for bash.exe. I was using method 2 all the time. And the font config keeps losing. I tried method 1 just now, and the font config keeps.
I can confirm that. CMD didn't apply DejaVu font like bash did.
@clarkzjw Could I ask you to repro the following steps:
- Upgrade to Win10AU if you've not already
- Open cmd from the start menu (non-elevated). Set its font to Consolas
- Close cmd window
- Reopen the cmd window from the start menu (non-elevated). It should have the same font as selected in 2.
Note that if you run Win + R -> cmd, you're running cmd.exe, which has a different set of properties to the shortcut used by the start-menu when you find and open the console from the start menu.
And if you open cmd or Command Line (start menu tile) or PowerShell and THEN run bash from within that console, Bash's font properties aren't used - just the fonts preferred by the console you first opened.
- @zadjii-msft & @paulcam206 for visibility 😉
@bitcrazed Exactly. I just followed your step. It seems the Command Prompt in Step 2 and cmd.exe via Win + R are different. I didn't noticed that before. Are they different before Win10AU?
@clarkzjw cmd.exe and Command Prompt are the same thing, but they are loaded slightly differently, so they each have separately stored properties (it's confusing, but legacy, behavior).
Changing the properties on a bash window launched from the start menu (Win Key -> "bash") should persist the properties, but again, separately from the properties of Win Key + R -> "bash".
Perhaps you're setting the "Defaults" and not the "Properties"? These are again, different (and complicated for legacy reasons), and in my experience, changing the "Properties" is the option you always want.
@zadjii-msft Well, things become more interesting after some additional tests.
First, I am pretty sure I am editing Properties, not Defaults. If I use Win Key -> "bash" to launch a bash window, and change the fonts in Properties. and type exit to close and reopen in the same way. I tried some different fonts, it seems some fonts can persist while some cannot.
But if I use Win Key + R -> bash to launch a bash window, and change font settings, in my tests, all fonts can persist, including the fonts failed in (Win Key -> "bash") case.
It's quite interesting. I am not sure if this is what you mean they are loaded slightly differently.
I think the difference is due to using shortcut or not, but not depends on using cmd or not.
You can go to system32 and double click the bash.exe instance, and it behaviors exactly the same as opening it through cmd. But when you use shortcut, it's different. (at least for me)
By different I mean both the font as and a coloring issue. This is the PS1 I am using:
\n${debian_chroot:+($debian_chroot)}\[\033[38;5;226m\]\u\[$(tput sgr0)\]\[\033[38;5;39m\]@\[$(tput sgr0)\]\[\033[38;5;46m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;87m\]\w\[$(tput sgr0)\]\[\033[38;5;28m\]\\$
It seems that only the bash launched through shortcut could display the color of the PS1 correctly. That's why I want to fix the font problem when using the Win Key + bash (shortcut) way to launch bash.
@clarkzjw That's strange to me. I'm gonna ping @bitcrazed and @paulcam206 (who has a bit more experience with the properties loading) to see if we can't triage this
@LeonYang5114 Are the colors on the "Colors" properties tab the same for both your bash.exe shortcut and launching it from Win+R the same? This is a bit of what I meant by they are loaded slightly differently - Launching from the shortcut stores the properties in the shortcut itself which the shortcut reads on future relaunches, while launching from Win+R launches the exe directly, reading&writing the properties from the registry.
Because the console doesn't support 256-color in the AU, \033[38;5;226m will get translated into the nearest color in the color table to color 266, so if you have different color tables, it will get translated differently depending on what's available. You can see #76 for more on this.
FWIW I just ran into what I believe is a general Windows console bug which I at first thought was WSL related, but no longer do. I'm just pointing it out on the off chance it's being encountered by anyone watching this issue.
To reproduce (on Win10AU):
- Open the font properties (via any method), change the font size to something that's not in the font size list (e.g. 15) by typing it into the provided edit box, OK out. (The size will change as expected.)
- Open the font properties again. You'll see that 15 has been added to the font size list and it's pre-selected. Leave it alone, choose a different font, and OK out. The font should change as requested, however it doesn't (and the new setting isn't persisted).
For whatever reason, if that 15 temporarily added to the list box remains selected, font changes are ignored.
The workaround is to ensure the 15 in the list box isn't selected before OKing out, either by selecting a different size or by entering 15 in the edit box.
My apologies for the noise it this is unrelated...
Hi Guys,
I am having exactly the same problem. The only thing I wanted to do is to use font consolas and save it as default. That used to work until after I install language package (Simplified Chinese). After that, the default font is always a Chinese font. I can manually change the font of current bash, while the setting cannot be saved for future usage...
It would be good to have the bug fixed asap. Appreciate it.
I have this same issue too. I figured that this may only happen to Asian installations.
Asian installations have different fonts available for use in a console session window than non Asian installations. (See the explanation here.)
While, for example, Consolas is available for use in console for non Asian installations (yes?), it is not shown in the font list of Command Prompt's properties setting window for Asian installations. However, it is shown and usable in Bash on Ubuntu on Windows.
I found that for any fonts shown in Command Prompt's font list, for example MS Gothic, the setting on Bash on Ubuntu on Windows could persist. (A shortcut is needed as pointed out by @LeonYang5114.) But for any fonts not shown in Command Prompt's font list, the font setting on Bash on Ubuntu on Windows only works for the current session. However, if we right click and see properties of the shortcut, we can see that font setting has actually been saved.
@all: There are several nuances to how and where console apps get their settings from when launched directly, via start-menu tiles, and via shortcuts / pinned apps. We'll be writing-up a blog post on this v. soon.
For now, remember:
- If you run a console app directly (e.g. via [Win] + [R] -> console app), its settings are pulled from the registry. If there are no pre-existing settings configured for a console app, its settings are initialized from the console defaults.
- If you launch a console app from a shortcut or tile, the settings for that app are pulled from the shortcut/tile. If you create your own pinned links to apps, each pinned link can have it's own font, colors, etc.
- If you make changes to the settings of a system-managed .lnk / shortcut / start menu tile / [Win] + [X] menu item, your settings will be restored to defaults each time you upgrade to a new OS build.
In the screenshot below, you'll notice that the two bash consoles, started via different means, have different fonts:

Same app. Same ConHost terminal, different settings due to different start-mechanisms. This can be a very useful feature if you want to create terminals with different settings for different tasks.
@bitcrazed,
It's been 19 days since you posted, and I hope your blog post is coming soon.
Still don't understand HOW to change the font when launching it via a Live Tile or Pinned app? Strange that it would be different from launching via a shortcut...
At least ConEmu supports Bash for Windows quite well so that's probably the best workaround until we've got clarification.
@ryanerwin Personally I recommend ALWAYS launching it via a Shortcut. The best way I've found is to Right click on the Start Menu shortcut, Pin to Taskbar, then change those properties. Bash for Windows for Ubuntu (i.e. bash.exe.) needs to Run As Administrator anyways, which can only be done via a shortcut. If it isn't Run As Administrator so many things do not work.