After performing a keyboard shortcut in tmux (I am not sure which), I am put into a state of perpetual copy-mode. I can type normally, but every time I hit the n key it prompts to gotoline input.

If I close the pane it happens even on the new pane I have created.

Any help on how to exit this once it happens would be great, as all documentation surrounding copy-mode states that when you hit Esc or q you should leave copy-mode.

  • 5
    Does Ctrl-C work any better? – B Layer Feb 17 '18 at 12:38
  • 1
    Dealing with the same problem. Ctrl-C does not resolve it. – x1a4 Oct 20 '19 at 1:20

Typically I get out of copy mode using Enter. On another machine with different desktop environment and different terminal, this doesn't work in tmux. But I did find a way.

If you look at the definition of the cancel key in copy mode ( Ctrl+c and Ctrl+Esc ) that's defined as

bind-key    -T copy-mode    C-c               send-keys -X cancel

That means you can do Ctrl+b to enter command mode and then execute

send-keys -X cancel

This will take you out of copy mode.

Variation on the theme would be to change your key mode to vi ( unless you already use that or your EDITOR environment variable already set to it):

set -g mode-keys vi

This allows hitting q in copy mode to cancel the said mode

As for how to deal with the problem of n key and gotoline, I can't answer that. I'd suggest trying different terminal emulator or keyboard, since the issue may not be related to tmux at all.

| improve this answer | |
  • 1
    As a sidenote, I don't know which version of tmux you're using but in version 2.9a pressing q exits the copy mode and I'm not even using vi keybindings. Also I found out ctrl+c, ctrl+x, ctrl+v to be working (and the keybindings are not even referenced into the help menu). hope it helps. – vdegenne Jan 22 at 12:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.