tmux: allow setting default-shell before new-session

This commit is contained in:
Joe Hermaszewski 2019-10-15 10:23:32 +08:00 committed by Robert Helgesson
parent 7c3c64208e
commit 9c14bbe988
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 70 additions and 1 deletions

View file

@ -27,6 +27,7 @@ let
defaultResize = 5;
defaultShortcut = "b";
defaultTerminal = "screen";
defaultShell = null;
boolToStr = value: if value then "on" else "off";
@ -41,7 +42,10 @@ let
set -g default-terminal "${cfg.terminal}"
set -g base-index ${toString cfg.baseIndex}
setw -g pane-base-index ${toString cfg.baseIndex}
${optionalString (cfg.shell != null) ''
# We need to set default-shell before calling new-session
set -g default-shell "${cfg.shell}"
''}
${optionalString cfg.newSession "new-session"}
${optionalString cfg.reverseSplit ''
@ -250,6 +254,13 @@ in
description = "Set the $TERM variable.";
};
shell = mkOption {
default = defaultShell;
example = "\${pkgs.zsh}/bin/zsh";
type = with types; nullOr str;
description = "Set the default-shell tmux variable.";
};
secureSocket = mkOption {
default = pkgs.stdenv.isLinux;
type = types.bool;