1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 23:21:02 +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:
robin 2025-08-01 16:53:46 +02:00 committed by GitHub
parent 08cf2543ea
commit 899af4218c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 21 deletions

View file

@ -84,23 +84,17 @@ let
''}
${
if cfg.prefix != null then
''
# rebind main key: ${cfg.prefix}
unbind C-${defaultShortcut}
set -g prefix ${cfg.prefix}
bind -N "Send the prefix key through to the application" \
${cfg.prefix} send-prefix
''
else
optionalString (cfg.shortcut != defaultShortcut) ''
# 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
''
let
defaultPrefix = "C-${defaultShortcut}";
prefix = if cfg.prefix != null then cfg.prefix else "C-${cfg.shortcut}";
in
optionalString (prefix != defaultPrefix) ''
# rebind main key: ${prefix}
unbind ${defaultPrefix}
set -g prefix ${prefix}
bind -n -N "Send the prefix key through to the application" \
${prefix} send-prefix
''
}
${optionalString cfg.disableConfirmationPrompt ''