Tabbed Command Shell with Console2


So lately I've been doing a lot of work trying to come up with a workflow for bridging client-side development tech such as AngularJS with NodeJS tools like browserify and gulp. This has resulted in my spending a lot of time with multiple shell (command) windows open at the same time. Usually some combination of the windows (cmd.exe) shell along with several nodejs command prompts and even a git bash. This was getting to be kind of irritating and unmanageable so I went on the look out for an app that I could use to consolidate my shells into at least a tabbed interface.

My Discovery

Cursory web searches turned up a lot of for-pay tools but to me this seemed like something that the open source community must have solved along the way. I was fortunate to come across Scott Hanselman's blog post titled: Console2 - A Better Windows Command Prompt from 2011 and was able to use his ideas as a template to get where I wanted to be.

Basically I needed to configure Console2 to behave as a tabbed command prompt interface that I could use to quickly (i.e. with a hotkey) launch an appropriate console.

I've set up the following Console "Tabs" for my use:

Windows(Default Shell)Ctrl+W
NodeC:\Windows\System32\cmd.exe /k "C:\Program Files\nodejs\nodevars.bat"Ctrl+N
Visual Studio %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"" x86 Ctrl+D
Powershell %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe Ctrl+P
Git Bash "C:\Program Files (x86)\Git\bin\sh.exe" --login -i Ctrl+G

I put the quotes around "Tabs" because really what you are doing here is creating a "type" or template for each tab. Once you have it configured you can fire up as many of whichever type you need. If you are doing NodeJS development, for example, and you want to keep your development server and karma test runner is separate windows, this can be pretty useful.

To configure all of this I followed a lot of Scott's instructions surrounding formatting (especially font and window transparency. It was very important to me that I feel like a subtle badass!) including whipping up my own icons--or re-using ones in the case of Git Bash; just need to dig around in the install folder to find it. The one thing I didn't change was the text color. Kermit green is awesome but some of the Node and Powershell tools that I use print to the console using various colors for different reasons and I wanted to preserve that behavior.

Inside the Console settings (if you disabled the toolbar you reach this by right clicking inside the app and selecting "Edit -> Settings") you can click on the Tabs pane and configure a new Tab type as I described above (or for whichever additional Shells you want to add). The process should be pretty obvious and self explanatory. When I was done my Tabs window looked like this:

The next step was to configure my hotkeys appropriately. By default it just assigns each "Tab type" a Ctrl + #... that is in my case it would have been Ctrl+1 for Windows, Ctrl + 2 for Node and so on. I wanted to set this up to have more easy to remember hotkeys such as described in my table above, so I went over to hotkeys and configured them appropriately:

Obviously I went out of my way to avoid important hotkeys like Cut/Copy/Paste.

Getting to the Point

I'm really happy with how this has turned out. Check out the image at the bottom with a common loadout of mine--lots of nodejs and one of everything else. Running in the active window is the karma test runner for one of my personal projects. Typically I'll be running this along with a development server to test/debug JavaScript and other code. Now instead of having a half dozen windows flying around the screen, I've got everything consolidated in a nice tabbed interface.

comments powered by Disqus