Ingredients:
- Cygwin, for unix commands in windows (ls, ps, grep, sed, awk, xargs, find, ssh, wget, cat, less, ...) along with your flavour of competent shell (e.g. bash, zsh, etc).
- puttycyg, for the terminal emulator itself. This is a patch over regular PuTTY that provides an additional connection option of a loopback interface ("Cygterm") to a local cygwin installation. So you get a decent configureable terminal in PuTTY, useable not only for remote connections but as a local terminal emulator for your favourite shell on your local Windows machine.
- Optionally (but highly recommended), PuTTY Connection Manager (puttycm) for a pretty decent multi-tab wrapper around all your PuTTY instances, along with configureable keyboard shortcuts for creating new tabs/sessions and navigating between sessions (no more shift?-alt-tab/taskbar clutter nonsense).
- Another optional is some proper fonts (i.e. not Courier *), for example: Liberation, Bitstream Vera, Inconsolata, Proggy, or any number of other high-quality programmer fonts that double up as decent terminal fonts. As a previous fan of Bitstream Vera Sans, after having worked in Windows for about a month now and discovering Consolas as a default-installed font of Office 2007, this has now become my primary choice and I would highly recommend it to others going forward. For some reason Microsoft continue to do pretty well in secondary areas, e.g. hardware/typography but poorly in their primary software capacity (hmm perhaps they're not too dissimilar to Apple after all -- or should that comparison be the other way round?).
Method:
- Install all the various applications and fonts you wish, and configure your PuTTY sessions as normal (Puttycyg will also pick up any preexisting PuTTY sessions you had created however). In order to create a new local Cygwin interface, simply create a new session with "Connection type" set to the (newly-available) option of "Cygterm" and specify the "Host Name/IP address" as a single dash (-) which instructs puttycyg to use your default shell.
- If working with more than one Cygwin installation the only consideration you'll need to have when using puttycyg is you'll need to start it in the working directory of the /cygwin/bin/ installation you want to use - so any shortcuts you create for the terminal be sure to modify the "working directory" accordingly (puttycyg does include a cygwin auto-detection method however which should be sufficient for single cygwin installations).
- You may also want to auto-load your local cygwin session in your shortcut (e.g. for a single-click terminal launch, or easy access via a launcher such as Launchy), in which case you simply need to add "-load
[cygterm-session-name]" to your shortcut's target command line. - If using zsh and Windows 7/Vista you may experience some irritating errors when starting the shell or executing commands; they are usuall some variety of "fatal error - unable to remap ...\zsh\*.dll to same address as parent(0x...)". There is thankfully a simple solution to this:
- ensure you have the "rebase" package installed in your cygwin instance
- execute "${CYGWIN_HOME}/bin/ash.exe"
- $ rebaseall
- Relaunch your Cygwin instances.
Colour RGB Values Default Foreground R:220, G:220, B:205 Default Bold Foreground R:220, G:220, B:205 Default Background R:44, G:44, B:44 Default Bold Background R:44, G:44, B:44 ANSI Black R:63, G:63, B:63 ANSI Black Bold R:112, G:144, B:128 ANSI Red R:112, G:80, B:80 ANSI Red Bold R:220, G:163, B:163 ANSI Green R:96, G:180, B:138 ANSI Green Bold R:114, G:213, B:162 ANSI Yellow R:223, G:175, B:143 ANSI Yellow Bold R:240, G:223, B:175 ANSI Blue R:154, G:185, B:215 ANSI Blue Bold R:148, G:192, B:243 ANSI Magenta R:220, G:140, B:196 ANSI Magenta Bold R:236, G:147, B:213 ANSI Cyan R:140, G:209, B:211 ANSI Cyan Bold R:147, G:225, B:227 ANSI White R:220, G:220, B:205 ANSI White Bold R:255, G:255, B:255
So, that's my recipe on how to get a decent local terminal emulator + shell set up in Windows. Please leave a comment with suggestions for alternatives or improvements if you have any; while the above is a significant improvement over the default cmd.exe behaviour it's still a way off a comparable Linux setup these days.


