Cygwin setup gotchas
If you have gained any level of skill with the standard Unix/Linux command-line utilities, you will not be content to use
cmd.exe. Yet many of us have no choice but to spend our days working on a Windows machine.
Thus the creation of Cygwin was completely inevitable.
Cygwin is great, but there are a few installations gotchas. Here are four things that tripped me up the first or second time around.
Where am I? Is this my home directory?
So you install Cygwin, fire it up, and try to determine your location:
Good! Let’s find our stuff:
Hmm . . . I think we aren’t quite home. Don’t worry about where we are (somewhere inside the Cygwin installation,) where to we want to be? To get to the files we are looking for, use:
$ cd /cygdrive/c/path/to/file
Rather than type out these paths regularly, you will probably want to make some symbolic links (
ln -s) to smooth the rough edges.
Why aren’t my favorite utilities here?
Now that we can find our stuff, let’s edit something.
-bash: vi: command not found
vi? I thought this was going to make my terminal Linux-y?
It turns out that the default Cygwin installation leaves out a few things that you might expect.
When you are installing Cygwin, don’t miss the “Select Packages” step, pictured below.
To include Emacs, as pictured above, click on ‘Skip’ so that it changes to ‘Keep’. Intuitive? Spend some time searching for you favorite programs and making sure they are included.
How do I install those utilities I overlooked?
So I missed some stuff. Do I run
sudo apt-get install [package-name]? Do I have to re-install Cygwin?
Neither. Just run
setup.exe again, and select the stuff that you missed. Keep that setup file around, you’ll come back to it again.
Can I have sane copy-paste?
Being experienced with the Windows terminal, I had learned that you could paste with Alt-Space-E-P, and to copy you just Alt-Space-E-K to choose ‘mark’, and then using a combination of the arrow keys and Shift, you carefully choose your selection, before you . . . I always forget how you select it, but if you get it wrong, you have to start all over.
You don’t have to live this way. Cygwin defaults to the standard Windows terminal, but includes the MinTTY terminal in the default installation. All you need to do is point your Cygwin shortcut to
mintty.exe which you will find in
C:\cygwin\bin, along with 500 or so other files.
Now you can copy with Ctrl-Shift-C, and paste with Shift-Insert, and you can select with your mouse. Remarkably civilized.
Once you clear these obstacles, you should have an extremely tolerable and Linux-y experience that allows you to forget that you are using Windows for hours at a time.