Cygwin Tips

Dealing with Windows/Unix Paths

You want to run a windows program from a cygwin prompt and need to pass it a path, but your Windows program complains because your path is in unix format.

The solution is to have cygwin translate the path for you using the command cygpath.

For those programs I regularly run from a cygwin prompt I create little shell scripts or aliases of the following formats.

/path/to/command `cygpath -w $1`

This translates the first parameter (the path/file in this case) to a Windows path before passing it on. Won't work for more complex command lines, but it's a start :).

My Cygwin Terminal sucks

Running a cygwin prompt in a DOS window sucks, you can't properly resize it, copy and paste doesn't behave and lots of other niggles and irritations.

One solution is to run a cygwin X-server and use term. But that sucks too, since X has a considerable overhead.

Poderosa is a pretty good solution, yet too heavy weight for my tastes and it feels a bit cumbersome, I much prefer PuTTY, since I use it all the time to connect to my home machines. I don't want to have to run an SSH server though.

Open source strikes again, the answer is PuTTYcyg! This version of Putty has been modified to take a new protocol called cygwin which will allow it to start a local cygwin prompt.

I actually use a shortcut to start it, you can just as easily replace the default cygwin .cmd file with this shortcut.

"C:\Program Files\PuTTYcyg\puttycyg.exe" -cygterm -

This creates a new cygterm putty session.

projects/linux/cygwin_tips.txt · Last modified: 2008/08/04 10:16 by martinsgill
Firefox 3 Mandriva Linux National Secular Society Humanism Lib Dems