1

I have mapped Ctrl-s key to save a file in .vimrc. This was working fine till I just installed tmux. (Note that it was working fine because I had "stty -ixon" set in my .bashrc file).

How can I get the mapping work again when opening vim from tmux window?

What I tried so far without success:

  1. Added stty -ixon in .bashrc
  2. Added stty stop undef in .bashrc
  3. Added both 1 and 2 in .bashrc
  4. Added unbind-key C-s in .tmux.conf
5
  • Does tmux intercept Ctrl-S? This must be documented somewhere. Can you change tmux keybinds? I bet that's also documented.... Commented Feb 10, 2019 at 14:48
  • @Useless I thought the same earlier and had tried "unbind-key C-s" in .tmux.conf but didn't help. Commented Feb 10, 2019 at 14:55
  • If you've done some research and tried some things already, could you say what you've found, and what you tried unsuccessfully in your question? Otherwise you're going to waste lots of time - both yours and everyone else's. Commented Feb 10, 2019 at 15:11
  • Apologies @Useless. Let me add that Commented Feb 10, 2019 at 15:13
  • 4
    does terminal output freeze with C-s in tmux when not in vim? Commented Feb 10, 2019 at 16:47

1 Answer 1

1

Thanks @jeremysprofile for the suggestion. Here is the solution that fixed my issue for future references:

tmux was working fine outside of vim for C-s. So, instead of opening vim straight by 'tmux new-window -n editor vim', I did 'tmux new-window -n editor bash' and then 'tmux send-keys -t my_sess:editor "vim" C-m'.

The reason above works is because now vim is opened under bash(which invokes the .bashrc prior to calling vim).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.