mirror of
https://github.com/tmux-plugins/tmux-sensible.git
synced 2024-12-22 03:18:48 +00:00
parent
fa3e8b91ea
commit
4967aa0ce7
@ -6,6 +6,8 @@
|
||||
- do not make any decision about the prefix, just enhance it
|
||||
- update `README.md`. List options set in the plugin.
|
||||
- do *not* set `mode-mouse on` by default because some users don't like it
|
||||
- if a user changes default prefix but binds `C-b` to something else, do not
|
||||
unbind `C-b`
|
||||
|
||||
### v1.0.0, 2014-07-30
|
||||
- initial work on the plugin
|
||||
|
@ -41,6 +41,17 @@ key_binding_not_set() {
|
||||
fi
|
||||
}
|
||||
|
||||
key_binding_not_changed() {
|
||||
local key="$1"
|
||||
local default_value="$2"
|
||||
if $(tmux list-keys | grep -q "bind-key[[:space:]]\+${key}[[:space:]]\+${default_value}"); then
|
||||
# key still has the default binding
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
# OPTIONS
|
||||
|
||||
@ -97,7 +108,9 @@ main() {
|
||||
# if C-b is not prefix
|
||||
if [ $prefix != "C-b" ]; then
|
||||
# unbind obsolte default binding
|
||||
tmux unbind-key C-b
|
||||
if key_binding_not_changed "C-b" "send-prefix"; then
|
||||
tmux unbind-key C-b
|
||||
fi
|
||||
|
||||
# pressing `prefix + prefix` sends <prefix> to the shell
|
||||
tmux bind-key "$prefix" send-prefix
|
||||
|
Loading…
Reference in New Issue
Block a user