Skip to main content

RXVT - a better console for Cygwin (Unix on Windows)

If you use Windows for software development you will have probably come across Cygwin at some point, the Unix shell for Windows (well a bit of a fake console but it will have to do!).

The console out of the box is a bash shell running within a normal Windows cmd prompt box, which is ok but doesn't really give you all the features of a proper Unix shell, click and drag to select text, middle click to paste, decent scroll buffers, etc.

However there is a solution to these issues - scrap the silly Windows DOS box and run RXVT instead!

First off you will have to run the Cygwin installer again (don't worry it's quite clever and won't corrupt your current version of Cygwin) and select the rxvt terminal package to install. Then continue the installation as normal so that you are left with the Bash shell shortcut icon.

You will now need to replace the normal DOS box bash terminal with the new RXVT one. Right-click on the shell shortcut and change the "target" and "start in" fields to be the following:
Target: C:\cygwin\bin\rxvt.exe -e bash -login -i
Start in: C:\cygwin\bin\
Note: make sure you use your Cygwin installation location rather than just copying the above...

It should now look like this:


That will get a basic RXVT terminal running but let's add a few extra things to make it look more like a normal Unix shell. Open your new terminal (which will open in your Cygwin home directory) and create a file called .Xdefaults which contains the following:
Rxvt.reverseVideo:      true
Rxvt.scrollBar_right: false
Rxvt.saveLines: 2048
#Rxvt.font: "Lucida Console-12"
Rxvt.font: "Monaco-20"
If you cat the file it should look like this:


The above sets the background to be black like a normal shell, creates a pretty big console buffer and puts the scrollbar on the left (personal choice). It also sets the font to a rather large but cool Apple Monaco font, if you want a more normal font delete the Monaco font line and remove the comment '#' from the front of the other Rxvt.font line.

If you now exit your console and open it up again you should now feel much more at home. Oh and don't forget that middle-click pastes your copy buffer... ;)

Technorati Tags: , , , , , , ,

Comments

Chris said…
Great post, Andrew! Was really tired of dealing with the lame windows terminal...
Andrew Beacock said…
No problem Chris, glad you liked it! I use Cygwin via RXVT every day and when I have to use the standard Windows command prompt I shudder...
Anonymous said…
I use rxvt on my Linux boxes and wanted something not the DOS prompt with Cygwin.

Works great, thanks!

Chris H (a different Chris than the first posting)
Virge said…
Thanks for the RXVT idea. I like it!
chriv said…
Thanks for this post. With a little experimentation, I was able to get rxvt looking exactly mintty (and I can use nano in rxvt).
chriv said…
Thanks for this post. With the info you provided, I was able to experiment with the command line parameters of rxvt, along with a .Xdefaults file, to make rxvt (native) look exactly like mintty. This is nice, because I can't run nano under mintty (but can under rxvt).