32

For some reason the Windows command prompt is "special" in that you have to go to a properties dialog to resize it horizontally rather than just dragging the corner of the window like every other app. Unsurprisingly this feature made it into P-P-P-Powershell as well -- is there any way around this via command prompt replacement or Windows hackery?

6
  • 2
    It's actually an artifact of the Windows console subsystem and how it interacts with the GUI. The relevant functionality (including command history and function keys) is not shell-specific and works even in own console applications. Powershell just inherits all this from csrss (or conhost in later versions of Windows).
    – Joey
    Aug 1, 2009 at 19:19
  • possible duplicate of Is there a better Windows Console Window? Jul 10, 2014 at 15:23
  • Powershell is awesome as a "language" but it is constrained to pretty much the same terrible 90's console experience as cmd.exe Aug 21, 2014 at 14:35
  • The question itself need editing. This whole thread is "Why is it so hard to resize a Windows command prompt console, and are the any alternate console applications?" Oct 27, 2019 at 16:02
  • I read the original question as "Are there alternates to Windows cmd.exe which expand on what/how cmd.exe processes?" -- In other (unix) words, what alternative shells are available on windows? -- 4DOS/4NT JPsoft is the oldest I am aware of. Oct 27, 2019 at 16:07

8 Answers 8

31

2019 Update:

  • Microsoft has released the terminal app on Github & the Windows Store, and it has tabs, panels, acrylic transparency, and other features.

2016 Update:

  • Windows 10's default conhost UI has more features, including free resize, transparency, etc (this includes cmd & powershell)
  • I now use ConEmu (walkthrough here) which has many features including tabs & split panes.
  • Other options include Cmder (which comes with additional tools built in), and ConsoleZ (a fork of Console2).
  • Console appears to no longer be updated
7
  • Console++ for eTerm-like transparency, but I can't resize the window.. should I be using the 1.5 or 2.0 release?
    – Luke
    Sep 30, 2008 at 17:06
  • Ah, installed 2.00b140 and it has resizing and all the fanciness.
    – Luke
    Sep 30, 2008 at 17:08
  • Hmm..only 5 minutes in and its already crashed on me. Beta was released in 2006 so it appears they're no longer actively developing. The search continues.
    – Luke
    Sep 30, 2008 at 17:24
  • Looks like a new version was released in Mar 2009, so its getting some attention after all.
    – Luke
    Aug 1, 2009 at 17:23
  • you're right - i was looking for Console! how u read my mind??
    – Claudiu
    Nov 12, 2012 at 22:38
12

I don't know if this is what you want: Resizing the Powershell Console Window. If so, I got this awhile ago: Just type: resize and use the arrow keys to adjust width and height.

##
## Author   : Roman Kuzmin
## Synopsis : Resize console window/buffer using arrow keys
##

function Size($w, $h)
{
    New-Object System.Management.Automation.Host.Size($w, $h)
}

function resize()
{
Write-Host '[Arrows] resize  [Esc] exit ...'
$ErrorActionPreference = 'SilentlyContinue'
for($ui = $Host.UI.RawUI;;) {
    $b = $ui.BufferSize
    $w = $ui.WindowSize
    switch($ui.ReadKey(6).VirtualKeyCode) {
        37 {
            $w = Size ($w.width - 1) $w.height
            $ui.WindowSize = $w
            $ui.BufferSize = Size $w.width $b.height
            break
        }
        39 {
            $w = Size ($w.width + 1) $w.height
            $ui.BufferSize = Size $w.width $b.height
            $ui.WindowSize = $w
            break
        }
        38 {
            $ui.WindowSize = Size $w.width ($w.height - 1)
            break
        }
        40 {
            $w = Size $w.width ($w.height + 1)
            if ($w.height -gt $b.height) {
                $ui.BufferSize = Size $b.width $w.height
            }
            $ui.WindowSize = $w
            break
        }
        27 {
            return
        }
    }
  }
}
1
  • @atomizer I completely agree, this is insane, goes to my script folder immediately. ;D
    – mjsr
    Sep 20, 2011 at 16:08
3

If you don't mind installing cygwin you can use it with xterm or rxvt. You'll also be able to use Bash as the shell instead of cmd.exe which is much nicer.

3
  • The problem with cygwin on Windows is that it is still hosted by cmd.exe, thus the resizing problems that Luke mentions are still there. Sep 30, 2008 at 17:07
  • 3
    Not if you use the XWindows rootless mode. Then you can open Xterms. I've been doing this for a couple years, and it works great.
    – Herms
    Sep 30, 2008 at 17:08
  • You can also use rxvt without running xwindows. Oct 9, 2008 at 3:12
3

This isn't quite what you're looking for, but the way I get around it is by using cygwin's rootless X-Windows mode and XTerms. I prefer the unix command line environment more then Windows' env, and the XTerm windows act just like any other window.

As for straight replacements, a quick google search shows these:

I haven't tried them, so I'm not sure if they have what you're looking for, but they might be worth a shot.

2

PowerShell v2.0 ships with an interactive shell, called the PowerShell Integrated Script Environment (ISE). It's not fantastic, but it's usually better than the console subsystem.

Good

  • Includes a PowerShell script editor, with colorization

  • Colorization as a type at the prompt

  • I can have multiple PowerShell sessions, including remote sessions, as tabs.

  • The ISE is PowerShell-aware, so I can manipulate and extend it with PowerShell. For example, see the "IsePack", which adds a ton of features, including copy-as-HTML.

  • Can easily scale the text

  • Conventional Windows resizing, cursor navigation, selection, copy, paste, fonts, etc.

Bad

  • Interactive console applications block waiting for input, and thus hang.

  • Console applications that detect whether their standard IO are redirected will think that is so, and thus act oddly. The worst is TFS's tf.exe. For example, 'tf submit' will submit without prompting, even though the prompt is GUI, not CLI.

  • A limited feature set out of the box. It's obvious they would like to make a much richer PowerShell IDE but did not.

2

Way after the fact, but things have improved in the meantime. ConEmu is highly configurable, and can be resized horizontally and vertically. It has the somewhat odd (to me anyway) behavior of resizing the font as the window is resized. There's some discussion about it here. And Scott Hanselman has written about it, including integration with FarManager.

0

You might consider installing FAR. It's an excellent text mode file manager and much more. It could also be resized by dragging the corner of the window :)

0

If you set the property 'Layout/Screen Buffer Size/Width' then, when prompted, choose 'Modify shortcut that started this window' it will remember the buffer width. Then when you start another command prompt it will be, for example, the original 80 wide, but you can now stretch it to whatever you set the buffer width to.

Command Prompt will not wrap at the current window width, only at the buffer width. Thus if you've set the buffer width to 120, but the window is only 80 wide the lines will wrap at 120 and you'll have to scroll to read characters past 80.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.