One day I realized that I really missed the keybindings from the command-line
when I was using the run dialog. In particular, I missed
p, and Bash's advanced tab completion. I started out to build a run
dialog with better bindings, but ended up just using bash itself.
In other words, it's like a terminal that you can launch with a single
keystroke, and that disappears as soon as you press
I have this bound to
Spawning a terminal
The funnest part of the project was figuring out how to control an interactive
bash process. For most projects it's sufficient to feed the commands to a
system, but in this case I had to pass all keystrokes through.
The ruby standard library has an excellent tool for this,
a pseudo terminal (as opposed to an actual terminal), and gives you an
object for input, another for output, and a final one for errors:
term_read, term_write, term_err = PTY.spawn "bash --login"
The rest of the project consisted of translating keystrokes from GTK into the
sequences that a terminal would expect, and translating the output from the
terminal into modifications to a
The source code is available on github.