views:

731

answers:

7

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?

+12  A: 

You're looking for Console. It also has tabbing and transparency options.

Factor Mystic
Console++ for eTerm-like transparency, but I can't resize the window.. should I be using the 1.5 or 2.0 release?
Luke
Ah, installed 2.00b140 and it has resizing and all the fanciness.
Luke
Excellent answer!
Mark Biek
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
Looks like a new version was released in Mar 2009, so its getting some attention after all.
Luke
A: 

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 :)

Ilya Kochetov
+1  A: 

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.

manicmethod
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.
David Mohundro
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
You can also use rxvt without running xwindows.
Eric Tuttleman
+1  A: 

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.

Herms
+2  A: 

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
        }
    }
  }
}
avgbody
This is total madness.
atomizer
A: 

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.

Richard A
A: 

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.

Jay Bazuzi