To be honest, I really like working in Windows 7. It’s fast, it’s stable (for me at least), I love the window arrangement hotkeys, and it’s hardly lacking for software support. Unfortunately, the default command prompt stinks; I feel most comfortable in a UNIX environment, so this article describes how to soup up the bash prompt installed as part of msysgit (Git for Windows). (Let me start by saying that to the best of my knowledge, Windows Power Shell has actually gotten pretty damn capable; several of my coworkers use it to do exactly what I’m going to describe below, and it definitely integrates well into the greater Windows infrastructure. I don’t know, YMMV.)
tl;dr:: download Ben Alman’s Bash prompt script to your home folder, then add a line to your .bashrc for your msys shell to source that file.
When you install Git for Windows, you get a pretty handy little application called “Git Bash” added to your context menu. This is a lightweight bash shell, provided as part of the MSys build environment. It’s not cygwin, but if you’re like me that’s just the point: I don’t need 99% of what cygwin provides, and Git’s Bash prompt loads quickly, runs fast, and integrates seamlessly with the Windows file structure:
$ cd /c/Users/KAdam/Desktop takes me right to my desktop, without any of cygwin’s directory aliasing weirdness. I get
ssh and more, and it even has a basic version of vim. Most usefully, however, MSys Bash lets me use some basic dotfiles.
In the UNIX world, dotfile refers to any file whose filename starts with a period (the “dot”). These are hidden files on UNIX-based systems, and are frequently used for configuration or utility files. For example, a
.bashrc file in your user directory (/c/Users/yourAccount/ on Windows) will let you specify custom command-line aliases, preferences and utilities for your user account’s Bash shell without impacting any global settings. Any developer likes to customize their environment, and dotfiles give you tremendous freedom to configure applications to your personal preferences. You can get pretty tricky with these.