mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
tmux: fix prefix and shortcut settings (#7549)
adjusting the tmux lines for setting the prefix. previously the prefix option would be set in the prefix key table, causing it to not register correctly. - updated tests
This commit is contained in:
parent
08cf2543ea
commit
899af4218c
3 changed files with 14 additions and 21 deletions
|
|
@ -84,23 +84,17 @@ let
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${
|
${
|
||||||
if cfg.prefix != null then
|
let
|
||||||
''
|
defaultPrefix = "C-${defaultShortcut}";
|
||||||
# rebind main key: ${cfg.prefix}
|
prefix = if cfg.prefix != null then cfg.prefix else "C-${cfg.shortcut}";
|
||||||
unbind C-${defaultShortcut}
|
in
|
||||||
set -g prefix ${cfg.prefix}
|
optionalString (prefix != defaultPrefix) ''
|
||||||
bind -N "Send the prefix key through to the application" \
|
# rebind main key: ${prefix}
|
||||||
${cfg.prefix} send-prefix
|
unbind ${defaultPrefix}
|
||||||
''
|
set -g prefix ${prefix}
|
||||||
else
|
bind -n -N "Send the prefix key through to the application" \
|
||||||
optionalString (cfg.shortcut != defaultShortcut) ''
|
${prefix} send-prefix
|
||||||
# rebind main key: C-${cfg.shortcut}
|
''
|
||||||
unbind C-${defaultShortcut}
|
|
||||||
set -g prefix C-${cfg.shortcut}
|
|
||||||
bind -N "Send the prefix key through to the application" \
|
|
||||||
${cfg.shortcut} send-prefix
|
|
||||||
bind C-${cfg.shortcut} last-window
|
|
||||||
''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
${optionalString cfg.disableConfirmationPrompt ''
|
${optionalString cfg.disableConfirmationPrompt ''
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ set -g mode-keys emacs
|
||||||
# rebind main key: C-a
|
# rebind main key: C-a
|
||||||
unbind C-b
|
unbind C-b
|
||||||
set -g prefix C-a
|
set -g prefix C-a
|
||||||
bind -N "Send the prefix key through to the application" \
|
bind -n -N "Send the prefix key through to the application" \
|
||||||
C-a send-prefix
|
C-a send-prefix
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,8 @@ set -g mode-keys emacs
|
||||||
# rebind main key: C-a
|
# rebind main key: C-a
|
||||||
unbind C-b
|
unbind C-b
|
||||||
set -g prefix C-a
|
set -g prefix C-a
|
||||||
bind -N "Send the prefix key through to the application" \
|
bind -n -N "Send the prefix key through to the application" \
|
||||||
a send-prefix
|
C-a send-prefix
|
||||||
bind C-a last-window
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue