in my .bashrc, I have

bind -r '\C-s'
stty -ixon
#bind C-s to go backword (puns) - moves cursor to previous [:space:] on cmd line
set -o ignoreeof
bind '"\C-s": shell-backward-word'
#bind C-d to go forword
bind '"\C-d": shell-forward-word'

These work on OSX High Sierra in iTerm2. However, if I'm in a tmux session (2.7) on the same, they do not work.

My .tmux.conf doesn't contain any instances of C-s or C-d, my prefix is C-a which shouldn't interfere. The only thing that references any of that is set-environment -g 'IGNOREEOF' 2 which should just tell tmux to ignore C-d.

I have no idea what is going wrong, or how to debug this issue. Any pointers in the right direction would be greatly appreciated. Thanks!

  • check your final bindings with tmux list-keys. check with stty -a that you still have -ixon. Run something like cat -vet and type the control chars to see what gets through. – meuh Sep 22 '18 at 17:12
  • cat -vet shows ^S for C-d and C-s both. stty -a shows both -ixon and -ixoff (which is not the most intuitive until I looked it up). list-keys shows only a handful of root commands, none of which should overlap. – jeremysprofile Sep 23 '18 at 2:44
  • This shows the control-s is being passed by tmux to the program (cat). Perhaps your shell has lost the binding? List them with bash -p – meuh Sep 23 '18 at 13:16
  • I don't think that's what bash -p does. From bash -c "help set" I don't see any bash argument that would list all bindings (it also says that -p has to do with setting effective uid/gid to the real uid/gid). I am confused, sorry. – jeremysprofile Sep 24 '18 at 15:23
  • Sorry, I meant bind -p. – meuh Sep 24 '18 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.