You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows 10 1809/19H1/20H1 breaks Powershell's console settings. Keeps opening with raster fonts. #280
Area-FontsRelated to the fontIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsProduct-PowershellIssues in the modern command interpreter, Powershell.exe.
Windows 10 1809 breaks Powershell's console settings. Powershell keeps opening with raster fonts. You can change the settings and see the result, but when you open the settings again (with or without closing the powershell inbetween) the font has reset to raster fonts in size 12.
The same happens to me only when using the Consolas font. If I use anything else - Courier New, Lucida Console, etc. - the settings are retained.
Reacted by Daniel Niccoli, Cy 'kkm' Katsnelson, TiloGit, Jorge Morales, MickeyWang, William Lim, Nirmal Guru, ertyz, Christophe Avonture, nth-block and 8 more
I'm almost certain this has to do with the fact that the new version of PSReadline is using the UTF8 codepage for displaying it's prompt, and when it does that, the console tries to recalculate the font.
I don't think this was even Powershell's fault. I have a note sitting around here somewhere that one of the most recent .NET Frameworks (4.7something) suddenly decides to use 65001 as the default code page for all apps and when that flips back and forth with other tools and codepages as they start and exit, we recalculate the font.
I have a bug on me to try to make that less painful, but it's really the sudden flipping between codepages that is making this be a problem.
Rich Turner (@bitcrazed) I'm not @Borkason but since I'm experiencing this issue I'll answer as well.
My display language is Spanish (Spain), and so is my regional format. The language for programs that don't support Unicode is English (United States), and I have the beta checkbox selected for UTF-8 Unicode. (Hope that's what you're looking for...let me know if you were asking for something else)
I "fixed" the problem by using Powershell Core. I first noticed that none of the Powershell settings does anything (but it did change the settings on cmd.exe). After a couple hours of trying different things I stumpled upon Powershell Core and as soon as I downloaded it, the settings I saved before took effect as soon as I opened the Powershell core preview.
Got the same issue while running some of commands (including scoop) from FAR manager - this effect just ruins how FAR is shown. Happens only with Consolas font and beta option enabled to use UTF-8 (65001) codepage in console. My locale is Russian.
As end-user - It's really annoying when program tries to be smarter than me. I can live with question marks instead of some of UTF-8 symbols, but this font changing just ruins display of programs that shouldn't be affected at all, like FAR manger. This is a pain.
For now I had to revert to Russian locale for console (back from UTF-8), yet this limits working with files named using symbols of other locales. I hope you can remove that special Consolas treating.
I have the same issue but only if i try to use consolas. probably Steve Lee (@SteveL-MSFT) is right.
I tried Lucida Console and this is working fine. So i guess Consolas is missing some glyphs for utf-8 (my codepage)?!
Powershell Core 7 works fine with all fonts.
Incredible, I bought a Windows laptop in 2020 (xps15) and I have the same issue. Probably hundreds of Windows updates later, and the problem persist. If PS Core was the future in 2019, why is not installed in 2020? The PS Core could be default, and maybe the old PS could be installed as fall back in case some one need for compatibility issue. Anyway, I installed the Windows Terminal and let's try it.
Marcelo Garcia (@marcelomgarcia) FWIW, the reason that PowerShell 7 is not installed in Windows by default is due to support and liability issues. Windows and PowerShell 7 have different support and so far as I can tell, the lawyers have not figured out a way to do it. For now, anyway. I am sure that everyone would love to see PowerShell 7 shipped inside Windows 10 or Windows Server.
Rember: Windows PowerShell is a core component of Windows 10 and the default installer adds it to your installed on your laptop. It is a fully supported component FWIW. IF you want PowerShell 7, however, that is a separate and non-integrated installation process.
Thanks for the explanation Thomas Lee (@doctordns). It's just somewhat frustrating issue, and for someone outside seems to be a "simple" problem. I'm install PowerShell 7.
Observation: if you have a BAT file where you call powershell script.ps1 two times the second call resets font to raster.
I've confirmed it and I can see why this happens. Here's a script that illustrates the issue (and I tossed in my sleep function for funsies):
@echo off &&@echo|set /p="chcp; Write-Host "$args run complete"">"%TEMP%\test.ps1"
echo/This test assumes your default code page is 437 and your console font is set to Consolas (or another font that the raster font bug occurs with)
call:sleep5
echo/
echo/This should say the active code page is 437 . . .
chcpcall:sleep3
echo/
echo/Running test.ps1 for the first time . . .
call:sleep .25
powershell.exe -ExecutionPolicy Unrestricted -File "%TEMP%\test.ps1""First"call:sleep3
echo/
echo/As you can see, the code page in PowerShell was changed to 65001, but after exiting, it still persists . . .
call:sleep 1.5
chcpcall:sleep3
echo/
echo/Now, watch what happens when we go into PowerShell with the code page already set to 65001 . . .
call:sleep4
echo/
echo/Running test.ps1 for the second time . . .
call:sleep .25
powershell.exe -ExecutionPolicy Unrestricted -File "%TEMP%\test.ps1""Second"del"%TEMP%\test.ps1"call:sleep3
echo/
echo/Assuming the bug is replicated, the console is now using a raster font
call:sleep3
echo/
echo/This concludes the test
call:sleep 1.5
echo/
echo|set /p="[Done]"&runas /user:# "">NUL2>&1
exit /b0
::Sleep function
:sleepsetlocalEnableDelayedExpansionsetx=%1.
setdec=%x:*.=%setint=!x:.%dec%=!setdec=%dec:.=%setdec=%dec:~0,3%if"%dec%"==".="setdec=1000if"%dec%"=="~0,3"setdec=1000if%dec%LSS10setdec=%dec%00
if%dec%LSS100setdec=%dec%0
ping 203.0.113.0 -n 1 -w %int%%dec:~-3%>NULendlocal
Inserting chcp 437 between the calls helps.
You can also put chcp 437 >$NULL in the ps1 file to prevent it as well.
when the default font was changed, East Asian users complained as their glyphs weren't being rendered since the font doesn't support it. So this code detects that the font and locale aren't compatible and switches it to one that will render.
Steve Lee (@SteveL-MSFT), after #10472 & #10477 this is no longer the case - Consolas should be able to render everything.
You might want to reconsider this and other similar workarounds, if any.
If your default codepage is 65001, this fix worked for me:
run intl.cpl -> Administrative -> Change system locale -> Uncheck "Beta: Use Unicode [...] language support -> reboot
This resets the codepage for PowerShell from 65001 to your local codepage (e.g. 437, 850) and it won't reset to raster font again.
For reference, see this post
If your default codepage is 65001, this fix worked for me:
run intl.cpl -> Administrative -> Change system locale -> Uncheck "Beta: Use Unicode [...] language support -> reboot
This resets the codepage for PowerShell from 65001 to your local codepage (e.g. 437, 850) and it won't reset to raster font again.
For reference, see this post
This is a system-wide setting, which breaks older apps, that use regional code pages. I mean enabling the UTF-8. Should be off by default (beta).
If you want to work around this issue but you also need PowerShell to print Unicode text, you may switch to codepage 437 before running PowerShell and then change the console encoding from within PowerShell.
For example, to get the clipboard contents in UTF-8:
Area-FontsRelated to the fontIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsProduct-PowershellIssues in the modern command interpreter, Powershell.exe.
Activity
winstliu commentedon Oct 14, 2018
The same happens to me only when using the Consolas font. If I use anything else - Courier New, Lucida Console, etc. - the settings are retained.
danielniccoli commentedon Oct 15, 2018
@50Wliu I can confirm that behaviour. Consolas resets to raster font. Lucida Console stays Lucida Console.
zadjii-msft commentedon Oct 15, 2018
I'm almost certain this has to do with the fact that the new version of PSReadline is using the UTF8 codepage for displaying it's prompt, and when it does that, the console tries to recalculate the font.
I thought we had some issues tracking this previously, but I can't seem to find them. Rich Turner (@bitcrazed) do you remember where they were? Or was it an internal mail thread with Jason Shirk (@lzybkr) and Steve Lee (@SteveL-MSFT)?
SteveL-MSFT commentedon Oct 15, 2018
Can someone provide an exact repro? Like what font are you setting to the shortcut. What font is it being set to?
danielniccoli commentedon Oct 15, 2018
Win-Rand runpowershell.miniksa commentedon Oct 15, 2018
I don't think this was even Powershell's fault. I have a note sitting around here somewhere that one of the most recent .NET Frameworks (4.7something) suddenly decides to use 65001 as the default code page for all apps and when that flips back and forth with other tools and codepages as they start and exit, we recalculate the font.
I have a bug on me to try to make that less painful, but it's really the sudden flipping between codepages that is making this be a problem.
doctordns commentedon Oct 17, 2018
I can't reproduce this here. Both Windows PowerShell and Powershell both start up in the font I set.
cloudhan commentedon Oct 17, 2018
@Borkason Have you tried
concfg cleanhttps://github.com/lukesampson/concfg
bitcrazed commentedon Oct 17, 2018
@borakson - what locale is your Windows configured to use?
winstliu commentedon Oct 17, 2018
Rich Turner (@bitcrazed) I'm not @Borkason but since I'm experiencing this issue I'll answer as well.
My display language is Spanish (Spain), and so is my regional format. The language for programs that don't support Unicode is English (United States), and I have the beta checkbox selected for UTF-8 Unicode. (Hope that's what you're looking for...let me know if you were asking for something else)
danielniccoli commentedon Oct 19, 2018
Rich Turner (@bitcrazed) German. And I upgraded from 1803. Forgot to meantion that.
danielniccoli commentedon Oct 19, 2018
Thomas Lee (@doctordns) which font?
doctordns commentedon Oct 19, 2018
I use Lucida Console (18 pt). But I've tested others and they too work after a restart of Windows PowerShell.
danielniccoli commentedon Oct 19, 2018
75 remaining items
edyu commentedon Nov 20, 2019
I "fixed" the problem by using Powershell Core. I first noticed that none of the Powershell settings does anything (but it did change the settings on cmd.exe). After a couple hours of trying different things I stumpled upon Powershell Core and as soon as I downloaded it, the settings I saved before took effect as soon as I opened the Powershell core preview.
CHerSun commentedon Apr 1, 2020
Got the same issue while running some of commands (including scoop) from FAR manager - this effect just ruins how FAR is shown. Happens only with Consolas font and beta option enabled to use UTF-8 (65001) codepage in console. My locale is Russian.
As end-user - It's really annoying when program tries to be smarter than me. I can live with question marks instead of some of UTF-8 symbols, but this font changing just ruins display of programs that shouldn't be affected at all, like FAR manger. This is a pain.
For now I had to revert to Russian locale for console (back from UTF-8), yet this limits working with files named using symbols of other locales. I hope you can remove that special Consolas treating.
dermoritz commentedon Apr 12, 2020
I have the same issue but only if i try to use consolas. probably Steve Lee (@SteveL-MSFT) is right.
I tried Lucida Console and this is working fine. So i guess Consolas is missing some glyphs for utf-8 (my codepage)?!
Powershell Core 7 works fine with all fonts.
marcelomgarcia commentedon May 23, 2020
Incredible, I bought a Windows laptop in 2020 (xps15) and I have the same issue. Probably hundreds of Windows updates later, and the problem persist. If PS Core was the future in 2019, why is not installed in 2020? The PS Core could be default, and maybe the old PS could be installed as fall back in case some one need for compatibility issue. Anyway, I installed the Windows Terminal and let's try it.
doctordns commentedon May 23, 2020
Marcelo Garcia (@marcelomgarcia) FWIW, the reason that PowerShell 7 is not installed in Windows by default is due to support and liability issues. Windows and PowerShell 7 have different support and so far as I can tell, the lawyers have not figured out a way to do it. For now, anyway. I am sure that everyone would love to see PowerShell 7 shipped inside Windows 10 or Windows Server.
Rember: Windows PowerShell is a core component of Windows 10 and the default installer adds it to your installed on your laptop. It is a fully supported component FWIW. IF you want PowerShell 7, however, that is a separate and non-integrated installation process.
What language is your computer?
marcelomgarcia commentedon May 23, 2020
Thanks for the explanation Thomas Lee (@doctordns). It's just somewhat frustrating issue, and for someone outside seems to be a "simple" problem. I'm install PowerShell 7.
I use English US.
alex-jitbit commentedon Jun 4, 2021
Observation: if you have a BAT file where you call
powershell script.ps1two times the second call resets font to raster.Inserting
chcp 437between the calls helps.More info https://superuser.com/questions/706562/why-does-running-powershell-change-my-console-font
God-damnit-all commentedon Jun 5, 2021
I've confirmed it and I can see why this happens. Here's a script that illustrates the issue (and I tossed in my sleep function for funsies):
You can also put
chcp 437 >$NULLin the ps1 file to prevent it as well.alabuzhev commentedon Jul 24, 2021
Steve Lee (@SteveL-MSFT), after #10472 & #10477 this is no longer the case - Consolas should be able to render everything.
You might want to reconsider this and other similar workarounds, if any.
githubkuyaya commentedon Sep 22, 2021
If your default codepage is
65001, this fix worked for me:run
intl.cpl-> Administrative -> Change system locale -> Uncheck "Beta: Use Unicode [...] language support -> rebootThis resets the codepage for PowerShell from
65001to your local codepage (e.g.437,850) and it won't reset to raster font again.For reference, see this post
CHerSun commentedon Sep 22, 2021
This is a system-wide setting, which breaks older apps, that use regional code pages. I mean enabling the UTF-8. Should be off by default (beta).
magiblot commentedon Sep 20, 2023
In case it may be useful:
If you want to work around this issue but you also need PowerShell to print Unicode text, you may switch to codepage 437 before running PowerShell and then change the console encoding from within PowerShell.
For example, to get the clipboard contents in UTF-8:
This works for me using PowerShell 5.1.19041.1682, Windows 21H1.
NikitaBeloglazov commentedon Feb 16, 2024
magiblot, Thank you so much! This helped me a lot ❤️