Blog | Admin | Archives

Patching PuttyCyg to Send Ctrl-Tabs

Recently, I started using Windows 7 on my laptop, which lead me to adopting PuTTYcyg as my terminal of choice. Also, in large part due to my new job at Facebook and my misgivings about some aspects of Mac OS X, I’ve been experimenting with my terminal setup a lot recently. My research during this time led me to learning about patching PuTTY to send ctrl-tab and ctrl-shift-tab. I thought that sounded like a good idea, but of course I was using PuTTYcyg now, so I had to do the patching myself.

It turned out that downloading and patching the code was straightforward enough: With a few development packages in cygwin (namely make and the normal C/C++ gcc), make worked (almost) without a hitch. All I had to do was download the PuTTYcyg icon (which was not included in the patch), and everything compiled properly. However, after compiling, when I ran a cygwin terminal, a second windows command-prompt-style window with a bunch of debug info popped up:

PuTTYcyg Issue

This of course was a non-starter, so I searched in vain for a few hours to try to fix this, and ended the night by opening a new issue at the PuTTYcyg home page.

The PuTTYcyg developer pointed me to the Makefile used to build the PuTTYcyg releases. In it are a few special XFLAGS that magically make the extra window not appear:

XFLAGS= -UDEBUG -UNO_MULTIMON

Using the new Makefile, I compiled again, and this time when I ran PuTTYcyg, there was no annoying extra window. Brilliant!

Feel free to contact me if you need any more info.

One Response to “Patching PuttyCyg to Send Ctrl-Tabs”

  1. Andy Says:

    Hi, you might be interested in mintty, which is a Cygwin terminal that’s based on PuTTY’s terminal emulation and that can be installed through Cygwin’s setup.exe or downloaded from http://mintty.googlecode.com.

    It’s got keycodes for Ctrl+Tab and Ctrl+Shift+Tab already built in (“^[[1;5I” and “^[[1;6I”), and it also supports xterm keycodes for Shift/Alt/Ctrl combinations with the arrow, editing, and function keys. There are a few other additional features such as window transparency or mousewheel scrolling in ‘less’.

Leave a Reply