I’m trying out tmux for a while. I’ve been a screen user for a pretty damn long time, but recently, my vim at work is causing screen to hang, and I always can only get out of it by kill -9’ing screen and losing all my state. Kinda makes the whole thing pointless.

tmux seems like a pretty close equivalent. The status line needs a bit more color work, and I had a little fun trying to get control-left and control-right recognized.

Turns out, Terminal.app doesn’t really send xterm’s version of control-left and control-right codes. I found this pretty helpful guide about the differences in keycodes. I didn’t go through everything they had there, but just the left and the right, as that’s what I use to switch between different windows. 

And the end of the tweakage, the keyboard part of my settings profile looks like:

(basically just inserted the “1;” in each of the entries. The odd thing is, Terminal.app sets up TERM as xterm-color, but then doesn’t send xterm-standard sequences by default? Actually, I don’t understand 100% of what’s going on. I don’t know if the 1; format is the new or the old way of doing things (it seems like the new way), and it matters if the other end (the Linux machine I’m ssh’ed to) understand the codes properly. But even in this modified form, the local emacs installed in OSX seems to understand the control sequences, so seems like no loss for now.

The conf on the tmux side is easy. In your .tmux.conf:

bind-key -n "C-Left" previous-window
bind-key -n "C-Right" next-window

Leave a comment

Your email address will not be published. Required fields are marked *