ctrl+c ctrl+p RET alt+tab and then repeat for the next window when I need to restart the program.This can be automated as I'm using the XMonad window manager. For this to work you need both XMonad and XMonadContrib from the darcs repositories. The functionality should be available in the yet-to-be-released 0.9 version.
The crucial parts of my xmonad.hs looks like this:
import XMonad.Util.Paste (sendKey)
(...)
, ((modm, xK_i ), sequence_ [sendKey controlMask xK_c,
sendKey controlMask xK_p,
sendKey controlMask xK_j,
windows W.focusDown])
ctrl+j is equivalent to the enter key. So as you can guess this keybinding sends ctrl+c ctrl+p enter and then moves the focus to the next window. Perfect for my needs. :)Thanks to
byorgey and ml of #XMonad of the freenode IRC network for helping out!


This is excellent for rapid experimentation.

