From 24de1890fcb9de9085350f97091a4828491782fa Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 30 Sep 2021 15:34:16 +0200 Subject: [PATCH] home: zsh: launch tmux when starting a shell --- home/zsh/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 27077cf..5dc9a63 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -46,6 +46,16 @@ in # Modal editing is life, but CLI benefits from emacs gymnastics defaultKeymap = "emacs"; + # Make those happen early to avoid doing double the work + initExtraFirst = + lib.optionalString config.my.home.tmux.enable '' + # Launch tmux unless already inside one + if [ -z "$TMUX" ]; then + exec tmux new-session + fi + '' + ; + initExtra = lib.concatMapStrings builtins.readFile [ ./completion-styles.zsh ./extra-mappings.zsh