0

The default command C-b l to switch between two latest windows doesn't work on my Ubuntu 16.04. But it works if set bind-key l last-window after started tmux server.

I tried to set the bind key command in ~/.tmux.conf: bind-key l last-window or bind-key a last-window

C-b l still doesn't work, but C-b a works.

Why C-b l doesn't work? How to trace the issue?

Reference:

How to switch between two latest windows in tmux?

Ubuntu tmux manual

Peter
  • 105
  • 3
  • It works for me in Kubuntu 16.04 (I use F1 instead of C-b). – Gribouillis Aug 20 '17 at 08:21
  • @Gribouillis, Thanks for your comments. I tried with F1 as the prefix key, it is the same for Ubuntu 16.04. `F1 l` doesn't work, but `F1 a` works. I want to keep the default prefix key. So any idea? – Peter Aug 20 '17 at 12:29
  • Did you check by typing `C-b :` to enter command mode, then `list-keys` ? – Gribouillis Aug 20 '17 at 13:07
  • @Gribouillis, yes, I checked with list-keys, only `bind-key -T prefix a last-window` is display, but defalut `prefix l` is not – Peter Aug 20 '17 at 13:34
  • Try perhaps `bind-key 'l' last-window` (with quotes) – Gribouillis Aug 20 '17 at 13:37
  • `bind-key 'l' last-window` (with quotes) doesn't work. – Peter Aug 20 '17 at 14:22
  • Have you tried [this solution](https://superuser.com/questions/406421/tmux-key-bindings-not-working) ? – Gribouillis Aug 20 '17 at 14:43
  • @Gribouillis, thank you very much. After removed the .tmux.conf, `C-b l` works. Then I tried with `tmux list-keys | grep "prefix l"` to find the bind key. It shows that `bind-key l select-pane -R` overwrite the default behavior. Thank you again. How can I close the question or make your comments as answer? – Peter Aug 20 '17 at 23:03

1 Answers1

0

Try to remove ~/.tmux.conf as in this thread.

List my steps: 1. find the bind key with tmux list-keys | grep "prefix l" 2. If exists with another command, remove it from .tmux.conf and restart your tmux; if it does not exist, your setting for bind key is not effective.

Peter
  • 105
  • 3
Gribouillis
  • 184
  • 5
  • I edited the answer and list my steps here. I didn't use `tmux kill-server` – Peter Aug 21 '17 at 08:49
  • @user1086907 Now I don't understand the second step. In your case, what was the result of `tmux list-keys | grep "prefix l"` ? Also you removed the `~/.tmux.conf` didn't you? – Gribouillis Aug 21 '17 at 08:54
  • 1
    I restore the `~/.tmux.conf` after found that the issue caused by it, then `tmux list-keys | grep "prefix l"`, and found that the shortcut is bound for another command. – Peter Aug 21 '17 at 09:41