56

This is a trivial problem, but it annoys me that I can't get to the bottom of it:

I'm running Windows 8, Powershell version 3.0. By right-clicking on the title bar I can go into the Properties and change the font, size, background colour etc without any problems.

After closing and restarting Powershell, all of the changes I've made stick except that if I've set the font to Lucida Console then on reopening I get the Raster font.

(Note that all of the above applies to when I run Powershell as Administrator.)

So:

  • If I set the font to Lucida, then it switches to Lucida for the remainder of the session.
  • If I set the font to anything other than Lucida, then it stays as that after closing and reopening.
  • If I alter the window sizes or text colours or anything else, the changes persist after reopening.
  • The only thing that goes wrong is that if I set the font to Lucida, it switches to 'Raster fonts' when I reopen.
  • But cmd and powershell ISE don't have this problem - only the powershell console.

Can anyone suggest what might be going wrong?

(One observation I've made is that upon re-opening Powershell after setting the font to Lucida, at first the width of the window is what it would be if the font were Lucida, but then after a second, it widens slightly to accommodate the raster font.)

10 Answers10

18

This guy had the problem as well. His solution worked for me too:

However, my shell in Windows 7 refused to save the setting and insisted on changing back to Raster Fonts when I re-opened PowerShell. It worked fine with Consolas, but I wanted Lucida

The Workaround: Select a font size other than 12 points.

Pieinacup
  • 189
14

I've found this behavior before, even with Windows 7. Try this - open a PowerShell window in admin mode (right click the icon open as administrator), change the font and close the window. Now open a PowerShell window with normal user rights and your changes should stick.

6
  1. Check which code page you are using
    I found the used current code page is not UTF-8 (65001). You can find the current code page in properties -> Options. OR, you can found it by using 'chcp' command

  2. Change the code page to UTF-8
    using command 'chcp 65001'

  3. Change other font
    you can use other font by change the powershell propertes

Giacomo1968
  • 58,727
Pegasus
  • 61
4

I too had this problem and I just fixed it by changing the system locale of my Windows installation English (United States). Swedish was apparently not supported with Lucide Console in PowerShell prompt. No idea why, but I blogged briefly about it here: http://www.meadow.se/wordpress/setting-the-font-of-a-powershell-console-to-lucida-console-wont-work/

Hope this helps.

emilast
  • 141
  • 3
3

I’ve experienced this as well - it seems to be related to fonts with a space in the name!

In the end I gave up and stuck with Consolas as my default CLI font (not as easy on the eye as Lucida Console, IMHO, but better than raster fonts). I did find a potential fix (but can't test it as I don't have admin access on my machine); however it's also worth a look at the SetConsoleFont module from the TechNet Gallery (there’s a 4sysops blog post that might help to get it installed/imported but I don't have a high enough reputation on this site to post that many links in a reply).

I seemed to be getting somewhere with that in that I could change the font and size from within a PSH session (so could presumably do this in my profile) but I didn't really want to go down the unsupported code route...

Giacomo1968
  • 58,727
2

Ubuntu Mono (downloadable from the many free font sites) @ 18pt looks almost identical to Lucida Console 14pts.
To get it appearing in the console, just add it to windows and add in a new string entry in:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\console\TrueTypeFont.
Name is 000 (probably... add on an extra 0 from the previous entry) and name is Ubuntu Mono. I just had to restart Powershell for it to find it (Win8.1)

2

This may come somewhat late, but I too had this problem. I solved this by unchecking Properties > Options > Use legacy console. After that, I could change the font and size and I got saved.

Mind that I did this with Windows 10.

Saphire
  • 183
0

If you're using a shortcut to run PowerShell, try running the exe directly (as an administrator) instead and change the default properties there. In your case make sure Lucida is highlighted under the Font tab. Recreate the shortcut if necessary once you're done changing properties.

Right click the shortcut and choose "Open file location" for an easy way to find the exe.

I tested this with PowerShell 5.0 in Windows 10

0

I have been working on this issue for two days now in Powershell on 2012 Server in a VM and finally today I found a site with a solution. From reading the site it seems the main cause of the issue is the fonts naming has a double-space in the font.

SOLUTION: Install new font and update registry key to match name, then set in Powershell Command Window Properties as normal.

Details here and all thanks to them :) http://www.bdhphoto.com/script-snippits/windows-powershell-snippits/powershell-font-fix-lucida/

WJDrury, ENGLAND

WJDrury
  • 11
0

I'm having this problem on a Windows Server 2012 VM running Windows PowerShell 4.

It seems there were two related issues:

  1. The issue mentioned in other answers, specific to Lucida Console. Pieinacup's answer didn't help me as I was trying to set it to 14 points, not 12, and I still saw the problem. Mark Wilson's answer, working around the problem by just using Consolas instead of Lucida Console, worked. However, it only worked when running PowerShell from the Start Screen. PowerShell was also pinned to the Taskbar and if I ran it from there I saw the same problem - it would initially open showing Consolas but after a second or so it would switch to a raster font.

  2. To fix the issue when running PowerShell from the icon pinned to the Taskbar: I unpinned it and re-pinned it. After that it worked the same as when I ran it from the Start Screen.

Simon Elms
  • 1,025