The Caboteria / Tech Web / TechNotes > ProgrammingNotes / CygwinNotes (30 Aug 2011, TobyCabot)
Cygwin is a unix emulation environment for Windows. If you must use a Windows machine to write code then Cygwin will help.

http://www.cygwin.com/

After installing Cygwin, you'll want to set up logins and passwords. You can use mkpasswd and mkgroup for this purpose, and take a look at the -d flag if you're running in a Windows domain.

See also http://xfree86.cygwin.com/ if you're planning on running X with Cygwin. You can run X in either single-window mode (with X inside one big Windows window) or multi-window mode where there is no X root window and X windows "float" along with Windows windows.

C:\cygwin\usr\X11R6\bin\startxwin.bat is a good way to start X. I hacked it to run rxvt instead of xterm - it seems to be more consistent with the terminals that I use on unix machines. There appear to be two solutions to cutting and pasting back and forth - download xwinclip and run it in startxwin.bat or add the -clipboard command-line parameter to X. I've used the command-line xwinclip but not the X feature.

rxvt can run both as a Windows program and as an X program, depending on where you run it from. You can make an icon for it by dragging the executable c:\cygwin\bin\rxvt.exe onto the little tray next to the Start menu. A useful set of properties for the "Target" field is

C:\cygwin\bin\rxvt.exe --loginShell -bg black -fg white -sl 1000 -e /bin/bash --login

this opens a white-on-black bash login shell.

Cygwin's rxvt seems to use ^H as the backspace character which seems to disagree with most Linux custom and practice, so it's a good idea to stty erase ^? in your .bashrc. Then backspace will work in bash and emacs.

http://www.khngai.com/emacs/bash.php - this page explains how to set up rxvt so that the delete key works as expected and so the "home" and "end" keys go to the beginning and end of the command line.

For a more in-depth treatment of backspace and delete see http://www.tldp.org/HOWTO/BackspaceDelete/.

Cygwin doesn't have a /etc/fstab - its mount points are stored in the Windows registry. See http://cygwin.com/cygwin-ug-net/using.html#mount-table

http://en.poderosa.org/index.html is a tabbed terminal emulator that supports cygwin.

GNOME makes it easy to change the caps lock key so that it works as another ctrl key, which is great if you're an emacs user. Here's a blog entry that shows how to do this in Windows: http://www.arunrocks.com/blog/archives/2008/02/20/5-indespensible-tips-for-emacs-on-windows/ . Here's an article that has a zip file with some registry modification files that make it easy to apply: http://www.howtogeek.com/howto/windows-vista/disable-caps-lock-key-in-windows-vista/

Topic attachments
I Attachment Action Size Date Who CommentSorted ascending
Unknown file formatEXT bashrc-cygwin manage 1.0 K 21 Dec 2006 - 16:28 TobyCabot example cygwin .bashrc
Unknown file formatEXT inputrc-cygwin manage 0.1 K 21 Dec 2006 - 16:28 TobyCabot example cygwin .inputrc
Edit | Attach | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Tech.CygwinNotes moved from Tech.CygwinTips on 15 Mar 2004 - 18:54 by Main.guest - put it back
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback