On 03/25/2011 10:49 AM, Paul Grove wrote: > 1. Ran xterm > 2. Checked my $TERM was equal to 'xterm' > 3. Checked my Ctrl-Arrow keys - they worked > 4. Ran tmux (from within xterm) > 5. Checked my $TERM was equal to 'screen' > 6. Checked my Ctrl-Arrow keys - they dont work > > Incidently, the same experiment, when done with screen instead of tmux, > screen also fails to work correctly until TERM=xterm, at which point all > 3 modify keys including Alt start working!
I think there are several problems for modified arrow keys. The biggest problem is that there's no standardized way to tell apps what most modified arrow-key combinations are. For instance, vim and some other apps just figure out what the control-arrow keys are by using special magic when they see the word "xterm" or "rxvt" in the beginning of the TERM name. Of course, this isn't very fair to other terms that aren't one of those. ncurses supports "extended" entries, which uses kUP5=... to specify what control-up should look like. However, I don't know what apps actually use that. Tmux itself does, which is why it's possible to bind C-Up to a command in tmux. Tmux doesn't pass these sequences through directly, though; it translates them. Screen passes them as-is, ignoring them completely. This lets apps work with them if TERM=xterm (but that breaks other things: screen.xterm-free86 is much better, but wouldn't handle 256-color support. I don't think there's a stock terminfo anywhere that offers an entry that has both 256-color and control-modified arrow keys in one place; you'd have to make the entry yourself). There's no entry that lets you do this for tmux, either, but you could create one. I played around with doing so for a bit; the trouble, though, is that I couldn't find an app that would respect the new definition, apart from a nested tmux (running a different session). So, the answer would appear to be that there is nothing portable you can do across all apps. I'm not even sure vim can be told to work with tmux's control-modified arrow sequences, since vim's support appears to be specific to xterm-style arrow sequences (think it supports rxvt-style ones too). -- Micah J. Cowan http://micah.cowan.name/ ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users