Console, Cygwin, and Windows 7

My DOS and Unix roots often show – I like using the command line. On all of my Windows-based systems I have Cygwin installed to provide many of the luxuries of Unix / Linux right from my windows system but the window that contains the Windows command line interface (cmd.exe) and Cygwin’s bash leave something to be desired. Copy and Paste is a pain and after growing so accustomed to having tabs in my browser, not having tabs to different command lines is a pain (especially when you connect to multiple systems which I often do, especially at work). A few years ago I discovered an open source project called Console. Console is a great little program. It supports copy and paste much like XTerm (just select text and it is copied, middle click and it pastes). I’ve been using it daily and loving it. It has one major drawback, though, in that it isn’t actively updated / worked on. Through Windows Vista that was fine, it didn’t really need any work but starting with Windows 7 there is some conflict that keeps it from working correctly. I did some searching but had a hard time coming up with a suitable alternative until I discovered mrxvt. mrxvt isn’t actually a Windows program at all but rather is a Unix program written in X that can be compiled and run using Cygwin.

mrxvt

Ultimately, what mrxvt provides is a tabbed xterm (well, a tabbed rxvt to be more precise). Getting it running isn’t quite as easy as just clicking install because -a- it isn’t a Windows program, they don’t provide Windows binaries for it, and because it isn’t a package that is distributed by Cygwin… but, it isn’t all that difficult. The steps are as follows:

  • FIRST! If you are installing on Windows 7, start with Cygwin 1.7. This may still be in beta, you might want to look here for the beta.
  • Download the Cygwin installer and install Cygwin including X. Follow these instructions to get Cygwin and X installed. You will need the following Cygwin packages (some of which are mentioned in the previous Cygwin/X instructions)
      X-start-menu-icons
      xorg-server
      xinit
      inetutils
      openssh
      xterm
      gcc
      make
      autoconf
      automake
      libiconv
      font-misc-misc (probably already there from the earlier X packages)
      libX11-devel
      all of the cygwin rxvt packages
  • Copy the “XWin Server” shortcut from the “Cygwin-X” program group to “Startup” so Windows automatically starts XWindows at bootup
  • Download the latest (0.5.4 at the time of this writing) mrxvt into your Cygwin
  • Move the mrxvt .tar.gz file to your Cygwin home directory. If the Windows user you are logged in as is named “Kevin”, your Cygwin home directory will be “c:\cygwin\home\Kevin”.
  • Start rxvt or xterm. The shortcuts for these should be in Start | Programs | Cygwin or Cygwin-X – it should start you in your Cygwin home directory (in Cygwin if your Windows user name is Kevin you will be in ~/Kevin or /home/Kevin – which are the same thing)
  • Extract the files from the .tar.gz with the command, change into the newly created directory
      tar zxvf mrxvt-0.5.4.tar.gz
      cd mrxvt-0.5.4
  • Configure before compilation – if you are missing any Cygwin packages you will probably learn about them here
      ./configure --enable-everything --disable-debug --with-save-lines=99999
  • Compile and install
      make
      make install
  • You can now make a shortcut on the Start menu to launch mrxvt. The Target of the shortcut should be
      C:\cygwin\bin\run.exe -p /usr/local/bin/ mrxvt -display 127.0.0.1:0.0 -ls
  • If you prefer to run CMD.exe (Windows Commmand shell) instead of Bash, you can set the Target of the shortcut to
      C:\cygwin\bin\run.exe -p /usr/local/bin/ mrxvt -display 127.0.0.1:0.0 -e cmd.exe
  • Finally, mrxvt is very customizable. The easiest way to customize it is to create a file named “.mrxvtrc” in your Cygwin home directory. My .mrxvtrc file contains the following content
      Mrxvt.foreground: black
      Mrxvt.background: AntiqueWhite
      Mrxvt.scrollbarStyle: next
      Mrxvt.scrollbarRight: True
      Mrxvt.xft: True
      Mrxvt.xftSize: 16
      Mrxvt.xftAntialias: True
      Mrxvt.command: /usr/bin/bash -l

Hopefully one day soon Console will be updated and support Windows 7. I don’t really love having to run XWindows to get a tabbed console that supports nice copy and paste, but for now this solution works.

Know of a better, simpler solution? Let me know!

3 thoughts on “Console, Cygwin, and Windows 7”

  1. Try using mintty, a module included with cygwin. I tried & abandoned rxvt when I found mintty. Mintty is similarly customizable (it even has transparency for inactive windows), has the same xterm style copying & pasting but has the advantage of a smaller footprint as it does not need X. It’s one weakness is that it’s multiwindow instead of tabbed.

    As an aside, I just moved to WinSevenUltimate64 to break the 3.5Gb memory barrier & found that cygwin/Windows integration has become much easier. Cygwin has always used /cygwin/home/username as the user homedir because the windows account equivalent has spaces. The use of spaces for “My Documents”, “My Pictures” etc was also a problem.

    Win7 now uses c:\users\username as the default directory & the “My ” prefix has been dropped. I was just able to finally unify my cygwin & Windows homedir by setting HOME & removing the login directory from my entry in the cywin password file. Once I moved .??* & the few directories i kept in my homedir from c:\cygwin\home\phayes to c:\users\phayes everything just worked!

  2. I ran into an issue when running the ./Configure step that said:
    configure: error: C compiler cannot create executables

    With a bit of Googling, I found that this was most likely due to a missing DLL. I was told to run:
    cygcheck `gcc -print-prog-name=cc1`Which showed that I was missing cygmpfr-4.dllI was told that the solution to this was to (rerun the Cygwin installer and) install the libmpfr4 package. I reran the aforementioned cygcheck command, and it showed that no dlls were missing, and I ran ./configure again, and it worked!

Leave a Reply