One of my first posts to this blog involved modifying the Windows command line to make it a bit more friendly to work with. Well it has been a long time since that post and I’ve decided to revisit the topic because I’ve since refined my command line experience.
Some people who need to do a lot of command line work in windows choose to run cygwin and bash, but that unfortunately is not an option for me so I’ve thrown together a bunch of opensource and freeware utilities to make the environment a bit more pleasant to work with.
Here are the goods:
Console which is a Windows console replacement that hides the actual cmd console window and pipes all input/output into a multi-tabbed interface that supports things like copy on select and ctrl+c/ctrl+v copy and paste, among other things. Trust me, if you spend a lot of time in the Windows console you want this.
It you are going to be using console, they I highly recommend getting a decent font for it. I personally prefer Deja Vu Sans Mono 9pt which you can get here.
I also prefer linux style font smoothing over Windows and have been using MacType to change the Windows font rasterizer, you can find more information here.
The last thing is a control code interpreter for cmd.exe like we use to have in the old days with ansi.sys. Ansicon is a great little application that does just that.
So now what…:
I still like the content of my command prompt with the line separated path info and input line, but it would be nice to have a visible separator between command inputs so I can quickly tell what the output was from the last command run. I decided on a clean blue line that stretches across the screen with green text. I tried a lot of color combinations and this one seemed the easiest on the eyes.
$E[s$E[K$E[44m$E[5C.$E[K$E[u$E[44m$E[1m$E[32m[$T$H$H$H$H$H$H]$E[44m:$M:$E[44m[$P]$E[40m$E[33m$_:$E[37m
Ok lets break this down…
$E represents and escape which will be followed by a control code, so every time you see $E you know a control code is next.
$E[s Tells the interpreter to save the cursor position $E[K clear the line $E[44 Set background color to blue $E[5C Move cursor forward . Type a '.' character $E[K Clear the line $E[u Restore cursor position $E[44m Blue background ( high intensity ) $E[1m High intensity $E[32m Green text ( high intensity ) [ Type a '[' character $T Insert the time $H Delete character $H Delete character $H Delete character $H Delete character $H Delete character $H Delete character [ Type a ']' character $E[44m Blue background ( high intensity ) : Type the ':' character $M Show remote machine name : Type the ':' character $E[44m Blue background ( high intensity ) [ Type the '[' character $P Insert current path ] Type the ']' character $E[40m Black background $E[33m Yellow text ( high intensity ) $_ Insert line break : Type ':' character $E[37m White text ( high intensity )
So that is all there is to it.. There is a lot more stuff you could do with ANSI control codes, experiment and see what works for you..


