March 09, 2004

Cygwin + Rxvt    [ Software ]

I've been playing around with Cygwin since I'm forced to run WinXP on my work laptop. Cygwin's great, I've used it on and off since when it was GNU-Win32 by Cygnus, but there's a lot of improvements to it in the last year or two.

One of the things that's irritated me is that the default console uses the cmd.exe shell as a base - makes it hard to copy + paste with the mouse, among other things.   After some effort, I found the right combination of tweaks to get Rxvt working as a decent console in Cygwin.

Step 1: Edit ~/.Xdefaults - the settings below create an 80x80 terminal window with a deep-blue-black background and yellow-white text (looks nice, easy on the eyes) and assign VIM-style color codes:

! ~/.Xdefaults - X default resource settings
Rxvt*geometry: 80x80
Rxvt*background: #000020
Rxvt*foreground: #ffffbf
!Rxvt*borderColor: Blue
!Rxvt*scrollColor: Blue
!Rxvt*troughColor: Gray
Rxvt*scrollBar: True
Rxvt*scrollBar_right: True
Rxvt*font: Lucida Console-12
Rxvt*SaveLines: 2000
Rxvt*loginShell: True
! VIM-like colors
Rxvt*color0:    #000000
Rxvt*color1:    #FFFFFF
Rxvt*color2:    #00A800
Rxvt*color3:    #FFFF00
Rxvt*color4:    #0000A8
Rxvt*color5:    #A800A8
Rxvt*color6:    #00A8A8
Rxvt*color7:    #D8D8D8
Rxvt*color8:    #000000
Rxvt*color9:    #FFFFFF
Rxvt*color10:   #00A800
Rxvt*color11:   #FFFF00
Rxvt*color12:   #0000A8
Rxvt*color13:   #A800A8
Rxvt*color14:   #00A8A8
Rxvt*color15:   #D8D8D8
! eof

Step 2: Modify your c:\cygwin\cygwin.bat to invoke your shiny new Rxvt instead of cmd.exe:

@echo off
C:
chdir C:\cygwin\bin
set EDITOR=vi
set VISUAL=vi
set CYGWIN=codepage:oem tty binmode title
rxvt -e bash --login -i
Posted by edobbs at March 9, 2004 10:58 AM