0

I just noticed that on my main system, the PowerShell console is not resizable in that when you press maximise, the width does not change, and you cannot drag from the bottom corner to the right etc and you cannot hold CTRL + roll-mouse-wheel to resize, i.e. this console box is just like DOS. However, when I am on another system (with the exact same build of Windows 10), the PowerShell console is fully resizable (all of the above restrictions are gone). Does anyone know why these two quite different consoles exist, both called PowerShell, and how I can get access to the good (i.e. more modern / resizable) one (and get rid of the DOS-like one)?

2
  • Have you checked the PowerShell version? Use Get-Host | Select-Object Version.
    – harrymc
    Commented Oct 2, 2022 at 8:28
  • Using your Get-Host command, I get on the bad / DOS-like console: 5.1.19041.1682. On the good / modern / resizable console: 5.1.19041.1682. Identical, but again, one console fully resizable, but the other is not...
    – YorSubs
    Commented Oct 2, 2022 at 8:51

1 Answer 1

2

The console window is not part of PowerShell – it's shown by Conhost.

Conhost is the common console window host for all "command-line" programs on Windows, i.e. the same kind of window is automatically displayed whenever powershell.exe or cmd.exe is started.

It doesn't involve DOS at all (cmd.exe hasn't been "DOS" since 1992), but it remained mostly the same ever since its original release as part of NT3.x and simply did not have resize or zoom functionality until very recently.

Conhost was somewhat improved through Windows 8.1 and Windows 10 to include various new features (zoom, dynamic resizing, Unix-style ANSI code support), but out of fear of breaking some existing programs it still allows the new "Conhost v2" additions to be disabled.

The "Use legacy console" toggle is at the bottom of in every console window's "Properties" dialog (which can be accessed through the window's AltSpace system menu):

Screenshot of the "Properties" window


However, after those updates, development of the original Conhost has been frozen once more – instead a new Windows Terminal app is being developed, which will become the new default console (and Unix-style terminal emulator) in Windows 11.

5
  • Thanks, that's it ... I have to find a way in PowerShell to turn this off in the registry for all computers I'm working at, as that's quite a head-scratcher if you are not aware of it (I wonder why it was on by default for this computer, must have gotten changed at some point, strange).
    – YorSubs
    Commented Oct 2, 2022 at 10:02
  • 1
    Conhost settings are under HKCU\Console (most likely it corresponds to the ForceV2 value), but I would instead suggest installing Windows Terminal as it's where all new post-Conhost development is done. Commented Oct 2, 2022 at 10:15
  • I agree completely on Windows Terminal. However, it's not installed by default, and when I'm working in my Windows Sandbox, it's not there. I also found that ForceV2 so I think I'll add a reg add /f for ForceV2 into my collected tweaks that I apply to all systems that I'm working on, just to make sure that Legacy setting is never turned on(!).
    – YorSubs
    Commented Oct 2, 2022 at 10:19
  • Windows Terminal has become the default console on Windows 11. In fact it’s the only version where that’s possible. Likewise, PowerShell not Command Prompt, became the default prompt on Windows 10 (through Conhost)
    – Ramhound
    Commented Oct 2, 2022 at 13:46
  • 1
    '@Raymond', what do you mean by this? PowerShell not Command Prompt, became the default prompt on Windows 10 This is not a valid statement. It's only a UI setting when you right-click the Windows Icon. One can of course set that back to cmd.exe. If you hit the Win+R, and type a PS command it will fail. If you type any normal cmd.exe stuff, it works, showing that cmd.exe is still the default. Using Win+R, you specifically have to type powershell ... to use it. Though WT is a far superior tool, as is VSCode over Notepad. They both should be the defaults, wholistically.
    – postanote
    Commented Oct 2, 2022 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .