-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toggle on/off all keybindings #237
Comments
Set the prefix to some key that doesn't exist and change it back when you're done. On 11 Dec 2015 20:48, Alex Cornejo notifications@github.com wrote:A feature which I miss in tmux, is the ability to turn on or off all the keybindings at once. Byobu (tmux wrapper) provides this feature with the Shift-F12 keybinding (see here https://help.ubuntu.com/community/Byobu) I prefer to use tmux on its own rather than Byobu, hence this feature request. This is VERY useful when you ssh into remote machines and open tmux there. That way, you can simply press toggle the keybindings off, then work inside the tmux in the ssh session, and then turn the key bindings on to work on the "outer" tmux. This is much more convenient than Ctrl-b b or Ctrl-b Ctrl-b, especially since it works out of the box with any custom user key bindings. —Reply to this email directly or view it on GitHub. |
@nicm unfortunately that is only a good solution when your bindings had a prefix already. For frequently used bindings, folks often use a single chord. Example, Ctrl-{h,k,k,l} is a frequently used binding to switch between panes. If I have to press the prefix before then it essentially removes the convenience of having a prefix-less biding for that action on the first place. |
Right but you could just unbind them and then put them back. I don't think an option to do this is necessary. For frequently used bindings, folks often use a single chord. Example, Ctrl-{h,k,k,l} is a frequently used binding to switch between panes. If I have to press the prefix before then it essentially removes the convenience of having a prefix-less biding for that action on the first place. —Reply to this email directly or view it on GitHub. |
Not sure what you mean by "set the default key", but per session key bindings would definitely solve this issue (and be super useful). I only requested the toggle because that seemed like an easier feature to implement, but I agree that per session bindings would be immensely more powerful. |
A per session option to set the default key table (the one that is returned to after a command is run etc), at the moment it is always called "root". If it was configurable you could set it to different tables for different sessions and set it to an empty table to turn off all key bindings. —Reply to this email directly or view it on GitHub. |
Try http://pastebin.ca/raw/3282694 But because of the way the prefix option works you will unfortunately still need to disable it (it is still a special case and always jumps straight to the prefix table). You can either set it to something rare globally and bind your real prefix: "bind -n C-b switch -Tprefix". Or just do it for the duration of you toggle command, something like: bind -Troot C-x if -F '#{s/empty//:key-table}' 'set prefix C-F12; set key-table empty' 'set -u prefix; set -u key-table' |
This is slightly updated version: http://pastebin.ca/raw/3282712 |
I think I will take a look at how we could avoid making the prefix key special, or at least allow it to be disabled more nicely. |
Ok I have just committed code so you can set prefix to None, so instead of swapping it too you can do (with this diff), something like: set -g prefix None To make C-b the prefix, C-b C-x switch key bindings off, then F12 C-x switch them on again. |
I applied the diff above as well, so it should all be there next time GitHub syncs up. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
A feature which I miss in tmux, is the ability to turn on or off all the keybindings at once.
Byobu (tmux wrapper) provides this feature with the Shift-F12 keybinding (see here https://help.ubuntu.com/community/Byobu)
I prefer to use tmux on its own rather than Byobu, hence this feature request.
This is VERY useful when you ssh into remote machines and open tmux there. That way, you can simply press toggle the keybindings off, then work inside the tmux in the ssh session, and then turn the key bindings on to work on the "outer" tmux. This is much more convenient than Ctrl-b b or Ctrl-b Ctrl-b, especially since it works out of the box with any custom user key bindings.
The text was updated successfully, but these errors were encountered: