Terminal: How can I change fonts in Bash permanently?

Created on 16 Feb 2018  ·  11Comments  ·  Source: microsoft/terminal

_From @Yaosen on August 31, 2017 5:8_

I followed this instruction to change my font in Bash. But it goes back every time I reopen it. How can I change fonts in Bash permanently?

_Copied from original issue: Microsoft/WSL#2463_

Area-Fonts Issue-Question Product-Conhost Resolution-Answered

Most helpful comment

_From @SwimmingTiger on October 6, 2017 8:31_

I have been struggling with the issue for a long time but I solved it today. My code page is 936 and I know that to solve the issue simply, I just need a font that supports the charset CP936 like SimSun. I tried some of combined fonts in Chinese and Western characters, but all didn't work. They have CP936 characters but they may not declare support for CP936 in font meta. So I cannot find them in CMD and PowerShell property. Only find in Bash property but not permanently.

But just now, I found "Microsoft YaHei Mono". You don't need any extra action, just install it, and then select this font in the Bash property. Then the font will never change again.

Download: Microsoft YaHei Mono.zip or CSDN

The font = Microsoft YaHei + Consolas


Chinese Simplified Version (中文版):

我被这个问题困扰很久了,不过今天终于解决了。我的系统代码页是936,我知道要简单的解决这个问题,我只需要找到一款像新宋体那样支持CP936字符集的字体就好。不过,我尝试过好几个中英文混合字体,但是都没有用。这些混合字体确实有CP936的字符,但是我怀疑它们没有在字体元信息里声明支持CP936。所以我在CMD和PowerShell属性里面都看不到这些字体,只有在Bash属性里能看到,但是无法持久保存字体设置。

直到刚才,我发现了“Microsoft YaHei Mono”。不需要进行任何额外的操作,只需要安装这款字体,然后在Bash的属性里面启用它就OK了。从此以后字体再也不会变成默认的了。

下载:Microsoft YaHei Mono.zipCSDN

该字体 = 微软雅黑 + Consolas

All 11 comments

_From @zadjii-msft on August 31, 2017 15:53_

Could you post a screenshot of your font property sheet? Like this?

image

_From @shevegen on September 2, 2017 9:13_

Nice screenshot - helps explain much faster than words alone. :)

_From @Yaosen on September 4, 2017 17:48_

image

_From @zadjii-msft on September 5, 2017 15:39_

Hmm. That looks pretty normal to me. Maybe try chaging the font, then also changing one of the color values (eg make black (1, 1, 1) instead of (0, 0, 0) and then hit okay. Does opening a new bash window after that persist the font?

_From @Po-wei on September 5, 2017 18:39_

@Yaosen It has been a bug for Chinese people for a long time....
If your code page is in US, then the changes won't go back.
However, if the codepage in 950 or 936, the changes will not persist.
You can check my post #1994 for some information.
And there are some work around for this -- use some 3rd emulator terminal.
In #757 also has some information.

_From @Yaosen on September 5, 2017 22:1_

Thanks!! I don't understand what you mean. Which should I read to solve
this problem? Or there is no way to solve it in bash and I have to use
another app? And it does not make sense that the bug is only existing for
Chinese since I bought my laptop in US and my windows is running in English
as well.

Thanks

https://mailtrack.io/ Sent with Mailtrack
https://mailtrack.io/install?source=signature&lang=en&[email protected]&idSignature=22

On Tue, Sep 5, 2017 at 11:40 AM, Po-wei notifications@github.com wrote:

@Yaosen https://github.com/yaosen It has been a bug for Chinese people
for a long time....
If your code page is in US, then the changes won't go back.
However, if the codepage in 950 or 936, the changes will not persist.
You can check my post #1994
https://github.com/Microsoft/BashOnWindows/issues/1994 for some
information.
And there are some work around for this -- use some 3rd emulator terminal.
In #757 https://github.com/Microsoft/BashOnWindows/issues/757 also has
some information.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/BashOnWindows/issues/2463#issuecomment-327265603,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUAQXVTKRjZSmtcfaYbLYBGflJGPOck2ks5sfZWEgaJpZM4PITpj
.

_From @SwimmingTiger on October 6, 2017 8:31_

I have been struggling with the issue for a long time but I solved it today. My code page is 936 and I know that to solve the issue simply, I just need a font that supports the charset CP936 like SimSun. I tried some of combined fonts in Chinese and Western characters, but all didn't work. They have CP936 characters but they may not declare support for CP936 in font meta. So I cannot find them in CMD and PowerShell property. Only find in Bash property but not permanently.

But just now, I found "Microsoft YaHei Mono". You don't need any extra action, just install it, and then select this font in the Bash property. Then the font will never change again.

Download: Microsoft YaHei Mono.zip or CSDN

The font = Microsoft YaHei + Consolas


Chinese Simplified Version (中文版):

我被这个问题困扰很久了,不过今天终于解决了。我的系统代码页是936,我知道要简单的解决这个问题,我只需要找到一款像新宋体那样支持CP936字符集的字体就好。不过,我尝试过好几个中英文混合字体,但是都没有用。这些混合字体确实有CP936的字符,但是我怀疑它们没有在字体元信息里声明支持CP936。所以我在CMD和PowerShell属性里面都看不到这些字体,只有在Bash属性里能看到,但是无法持久保存字体设置。

直到刚才,我发现了“Microsoft YaHei Mono”。不需要进行任何额外的操作,只需要安装这款字体,然后在Bash的属性里面启用它就OK了。从此以后字体再也不会变成默认的了。

下载:Microsoft YaHei Mono.zipCSDN

该字体 = 微软雅黑 + Consolas

_From @Yaosen on October 8, 2017 22:16_

It works!!!! Thanks so much!!

_From @choidamdam on October 24, 2017 0:54_

@zadjii-msft
Exactly the same issue occurs on Korean version too. I think the font fallback need to be implemented locally (not for the whole text) and temporary.

I think I just figured out how it could be addressed without installing new font.

Go to Control Panel - Clock, Language & Region - Locales - Region - Administrative - Language for non-Unicode programs - Change system locale, there you click on the Beta checkbox, after a reboot my WSL terminal finally got my font settings right!
I tried tmux, vim, vim in tmux, etc., all functioned well.

My OS version is Windows 10 profesional, version 1809, 17763.529.


中文:前往 控制面板 - 时钟和区域 - 区域 - 管理 - 非Unicode程序的语言 - 更改系统区域设置,勾选“Beta版:使用Unicode UTF-8提供全球语言支持”,重启后WSL字体就不会再混乱了。测试过tmux,vim,tmux中使用vim,都没有出现字体回滚的问题。

https://github.com/Microsoft/WSL/issues/2463

I'm going to close this. It was originally a question on how to do something that was answered. And then it morphed into needing font fallback (which the DX renderer component is doing now).

As a result, I believe this is taken care of.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xmm1989218 picture xmm1989218  ·  3Comments

zadjii-msft picture zadjii-msft  ·  3Comments

ghvanderweg picture ghvanderweg  ·  3Comments

waf picture waf  ·  3Comments

mrmlnc picture mrmlnc  ·  3Comments