Entries in Powershell (2)

Saturday
Sep032011

Console2 + Powershell: A Better Windows Command Prompt

Windows has always had a ponderous command-line experience. And no wonder, because for the longest time, Microsoft developed Windows to be GUI-first. As a result, the terminal shell in Windows was always something of an afterthought (until Windows PowerShell happened). While PowerShell is a big improvement by virtue of its .NET roots and UNIX-inspired command set, the UI still suffers greatly from strange issues of old, e.g. fixed window size and screwed copy-paste.

Fortunately, free software comes to the rescue. Console2 is a software project hosted on SourceForge and describes itself as (citing their project page):

Console is a Windows console window enhancement. Console features include: multiple tabs, text editor-like text selection, different background types, alpha and color-key transparency, configurable font, different window styles

Yeah, Console2 adds everything Command Prompt lacks, and it gets better, because we can configure it to use PowerShell as its shell to create the ultimate Windows command-line environment.

Here's how.

Download & Install Console2

Get it from its project page at SourceForge, here.

(optional) Download Windows PowerShell

If Windows Update hasn't already installed PowerShell on your system, you might want to fire up Windows Update manually and enable it. If you're running Windows XP, you can get it manually.

Configure Console2 to use PowerShell

Open up a Console2 instance and open the settings dialog via Edit > Settings.

Use the browse button next to the Shell field to select powershell.exe from its installation directory. On my system (a Windows XP machine, issued by work..), I used a system variable to reference the PS executable, like so:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

Hit OK.

I've been using this setup for a couple of months now and I'm extremely satisfied with it. The combination of PowerShell and the features Console2 adds, I'm in CLI Nirvana whenever I need to use it.

That's all folks!

Sunday
Feb062011

How to make Command Prompt maximize properly

UPDATE: Console2 + PowerShell: A Better Windows Command Prompt

Command Prompt (or Windows Powershell) is one of those things you only appreciate after spending some time with command-line tools like Mercurial or Maven. Command prompt is a true utilitarian application with very few bells and whistles, and due its basic nature it has few problems to complain about. 

Except for it not ever wanting to maximize all the way! Drives me nuts, really. Turns out there's a solution that involves changing text buffer sizes:

To open this Properties dialog:

  1. Open a Command Prompt or Windows Powershell and right click the title bar and select Properties.
  2. In the Layout tab you'll see a section called Screen Buffer Size, the width field is usually the culprit.

To make the command prompt window fit snugly when maximized, you need to change the width of the screen buffer to be equal to one eighth of your screen resolution. In my case that resolves to 1280 / 8 = 160.

Click OK. Low and behold, the maximize button finally behaves.

Now if only there was a way to make the Mac's green orb button do the same.. But that's another matter entirely.

Note: Powershell is really the way to go and should be used in lieu of Command Prompt, in my opinion. It still puzzles me why Microsoft hasn't replaced Command Prompt with PS.