3

I have the following prefix-less key bindings in my tmux.conf.

bind -n C-J swap-window -t -1
bind -n C-K swap-window -t +1
bind -n C-H select-window -p
bind -n C-L select-window -n

These bindings are activated by the intended C-H, C-L, etc. The problem is that they are also activated by their lowercase counterparts, i.e. C-h, C-l, etc., which is interfering with command line key bindings. Why would this not be working as expected?

2 Answers 2

4

Most terminals just do not distinguish between Ctrl and CtrlShift – the resulting input always has the same bits unset (0x6f o or 0x4f O → 0x0f ^O).

You can verify this using stty cbreak; xxd -c1 and pressing various combinations of CtrlO and CtrlShiftO; you'll see the program seeing everything as 0x0f.

1
  • Okay, thanks for this, and especially for the verification command. I've decided to use the meta key instead since it is distinguishable.
    – stereolink
    Oct 20, 2015 at 10:25
2

Apparently some terminal emulators provide an option via .Xdefaults/.Xresources to modify specific keycodes.

I currently have the following in my .Xdefaults and it works with urxvt like a charm:

URxvt*keysym.Shift-Prior: string:\002[
URxvt*keysym.Shift-Up: string:cd ..\n
URxvt*keysym.Shift-Down: string:cd --\n

See here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .