Console2 - A Better Windows Command Prompt
I was working on my Mac today and while I maintain that the OS X finder is as effective as shooting your hands fill of Novocaine, I remain envious of the simplicity of their Terminal. Not much interesting has happened in the command prompt world in Windows since, well, ever. I actually blogged about text mode as a missed opportunity in 2004. That post is still valid today, I think. Text is fast. I spend lots of time there and I will race anyone with a mouse, any day.
I blogged about Console2 as a better prompt for CMD.exe in 2005. Here we are 6 years later and I hopped over there to see Console2 was still being developed. They were on build 122 then, and they are, magically and to their extreme credit, still around and on build 147. Epic.
Open Source projects may be done, but they are never dead.
I downloaded Console2 at http://sourceforge.net/projects/console/files/ and put it c:\dev\utils which is in my PATH.
Here's how I set it up for my default awesomeness.
- Right-click in the main console and click Edit | Settings.
- Under Console, set your default Startup Directory
- Under Appearance|More, hide the menu, status bar and toolbar.
- Under Appearance, set the font to Consolas 15. Not 14, not 16. Black background, Kermit green foreground color.
- Set Window Transparency to a nice conservative 40 for both Active and Inactive. Not too in your face, but enough glassiness to say "I'm a subtle badass."
- Under Behavior set "Copy on Select"
- Under Hotkeys, change the New Tab 1 hotkey to Ctrl-T because that's what it should be. You'll have to click on the hotkey, then in the textbox, then type the hot-key you want AND press Assign for it to stick.
- Under Hotkeys, change Copy Selection to Ctrl-C and Paste to Ctrl-V then rejoice and wonder why Windows doesn't work like this today. At this point, you may want to device if you want "Copy on Select" to happen automatically under Behavior. That'll save you the Control-C if you like.
- Now, the subtlety. Under Tabs, you (if you are me) want two default tabs, one for CMD.EXE and one for PowerShell because you don't like your peas and carrots to touch on your plate.
- Set your Console|cmd.exe first tab to this shell if you want it to be a Visual Studio command prompt. Be aware of the PATH if you are not on x64 like I am.
- %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
- I also set my icon to the vscommand.ico custom awesome VS icon I created a while back.
- Then, make another Tab called PowerShell with this path:
- %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
- And I used the vspowershell.ico icon 'cause I'm into flair.
- Set your Console|cmd.exe first tab to this shell if you want it to be a Visual Studio command prompt. Be aware of the PATH if you are not on x64 like I am.
You'll have a nice "New Tab" option where you can make one of either shell. Note the general loveliness of this understated shell. I can open a new Tab with Ctrl-T (or lots) and use Ctrl-Tab to move between them. I took the screenshot with the background so you can see the transparency.
One final reason why Console2 rocks? It's freaking resizable in two directions, unlike the Windows CMD.exe console.
Console2 is a great little front-end for your existing shell, no matter what it is. Note that Console2 isn't a shell itself, it's just a face on whatever you are already using. Enjoy.
Related Links
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
How can I make Console2 appear when I click "open command window here" in the Windows 7 file explorer?
AdrianG - Maybe make a custom INF? Make your own Command Prompt Here (old blog)
http://brianreiter.org/2010/08/08/upgrade-and-zenburn-the-console-window/
To setup other machines quickly, just copy your config file. I have mine on github https://github.com/fschwiet/fschwiet-local-config/blob/master/console2.config.xml
You can also sprinkle in some AutoHotKey goodness for a Quake style console
Console2 makes sense for cmd.exe, but for Powershell, I rather prefer to use either Powershell ISE or (even better) PowerGUI console.
Martin
Dead easy to do - just download PyCmd, and in Console2 settings, set the "shell" to C:\Tools\PyCmd\PyCmd.exe (or whever you installed it).
http://goingspare.wordpress.com/2007/03/29/adding-open-with-console-to-the-context-menu/
I was actually disappointed that Console2 doesn't appear to have one-click Maximize. I've been doing this in cmd with my increased screen buffer sizes.
Also, turn on ClearType for much better reading.
Quick comment .. the link to "icon to the vscommand.ico custom awesome VS icon I created a while back" in the middle of the post is broken.
http://gurustop.net/blog/2010/12/23/small-tip-using-console2-with-powershell/
I have a .Net 4.0 (VS2010) command prompt, a .Net 3.5 (VS2008) command prompt, PowerShell and Git bash... but I didn't have icons for dos/power shell. Thanks for those.
Oh, and I also set up my registry so I get "Open Console Here" when I Shift-Right on a folder. Easy, Peasy.
I just wish Console2 would remember it's last position/monitor so it would open in the same place all the time.
BOb
f I cd to %SystemRoot%\System32\WindowsPowerShell\v1.0\Modules\ I see only like 3 modules, while I have more; specifically the AppFabric Console module.
I was hoping to create a couple of tabs for managing the appFabric cache server in 2 differnet clusters I have and I wasn't able to load the module ... any ideas???
Unfortunately, the link to your uber-icons is broken... I get a 404 when I attempt to download...
I have a lame workaround here.
Also, there is some weirdness interacting with out-gridview. The first time you use out-gridview, you get an invisible window. The icon shows up on the taskbar but there is nothing to interact with visually. If you pipe to out-gridview a second time it works and continues to work from then on in that console2 session.
One of my sure-to-be-crushed hopes for Windows 8 is that conhost.exe will implement dynamic buffer re-sizing by dragging the window chrome and also line-oriented select instead of the block mode. That's all I ask.
@fschwiet Thanks for the ZenBurn link. Always nice when others do the hard work.
Just noticed the issue with the up-arrow not working. Not sure how to fix that.
IIRC, a lot of the slowdown was because people went into a vagued-out state (I'm possibly not using the correct scientific jargon here) trying to recall the correct commands to type. But they didn't notice that they had.
Anyway, command lines are so 1970's. You'll be telling us about your purple flares next :-)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Console]
[HKEY_CLASSES_ROOT\Directory\shell\Console\command]
@="\"C:\\bin\\Console.exe\" -d \"%L\""
(i mean when running console applications...)
I downloaded Console2 at http://sourceforge.net/projects/console/files/ and put it c:\dev\utils which is in my PATH.
Or better yet, drop your entire utils into Dropbox. Mmmm, now that's bliss!
Copy the contents of the x64 (or x86) folder of ansi140.zip into your Console2 installation folder, then create a new tab with this command line:
C:\Program Files\Console2\ansicon.exe "C:\Program Files (x86)\PuTTY\plink.exe" -load someprofileofyours
I also give my background color a slight hint of green (0, 16, 0) instead of pure black.
Juan Zamudio
Thanks! Knowing the best tools to use is one of the biggest helps in the industry.
Quick tip. You can also use the -t <tab name> command line parameter to open a specific tab. That allows you to do things like "Open Specific Tab Here" in Explorer.
I second the request to see your C:\dev\utils listing - or actually your C:\dev\ tree even. One thing I'm wondering (as I migrate to a new work laptop and therefore think about all this stuff for the Nth time in P years) is should you put all your source code in C:\dev or C:\projects or similar, or keep it in your docs home as Visual Studio wants? And now we have all kinds of links available in Windows, if you want to put it in C:\ do you use a link, or do you just change the location in VS?
By the way, for those who also like Python, this works quite well http://ipython.scipy.org/moin/IpythonOnConsole (although arguably DreamPie is better).
But nothing beats cygwin with the puttycyg frontend. At least for me since I come from the *nix world.
http://cd.textfiles.com/sigserieswin/WOLRS/WOLNEW.LST
search for "WINDOS.ZIP" on this page.
I'm old, sigh ...
http://www.softintegration.com/docs/ch/shell/
1. Go to Edit -> Settings -> Tabs.
2. Add a new tab titled "Bash".
3. Set the "Shell" path: "C:\Program Files (x86)\Git\bin\sh.exe" --login -i".
4. Move the new tab entry to the top of the list.
The best bit is being able run different types of shell side-by-side. I haven't had much luck using it as a PuTTY shell though (instead, install Cygwin/ssh and create a new Console2 tab with a shell command like "c:\cygwin\bin\ssh.exe user@hostname" seems to work well.)
Great tip about the icon editoron the other page btw -- the icons that Microsoft supplies all suck. I'm scandalized you can't just use normal graphics files like .png, .jpg (or even .bmp and .wmf) for icons in Windows 7 -- come on!).
On my Win7, I upgraded to PowerShell3 a few months ago. Now PS is in two places.
Location 1. %SystemRoot%\SysWow64\WindowsPowerShell\v1.0
and
Location 2. C:\Windows\System32\WindowsPowerShell\v1.0\
After the upgrade, I customized powershell startup (like background, fonts etc.), and that profile is kept in my user folder.
If Console2 is configured with SysWow64, it fails to see that customized profile and errors out, but with System32 path it just works fine.
Why PS3 are in two places? Is there a conflicting situation when console2 initializes powershell?
As explained here - http://stackoverflow.com/questions/3780378/how-to-display-japanese-kanji-inside-a-cmd-window-under-windows
"cmd.exe can display Unicode characters, but only if the process it is running passes it Unicode, via wprintf or Win32 WriteConsoleW. Most command-line software, however, uses the C stdio byte-based output functions like printf, so you'll be limited by the codepage. It is very unfortunate that on Windows the system default codepage can never be 65001 (UTF-8), and that there are some serious bugs with setting chcp 65001 at all. Every other OS has standardised on UTF-8, allowing any old byte-based console app to do something sensible with Unicode"
I could never get my Windows command-line to show any of my files/photos with japanese characters in them. With a Mac you can buy it from a store in Australia; get home; turn it on; type 'ls' and see Japanese characters in the console, if you have filenames with them in it - no way you can do anything like that on Windows.
...you may want to device if you want "Copy on Select"...
Should be "decide"?
Settings > Hotkeys > scrolling up/down > clear and assign to disable them, so it won't scroll the buffer anymore using these keys (quite annoying :).
Comments are closed.