From 40b3ee8f378eacd3f6e80964999e82092d617e7c Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 4 Oct 2024 22:02:49 +0200 Subject: [PATCH] Move tmux session creation at the very top of zshrc --- modules/cli/zsh/default.nix | 7 +++++++ modules/cli/zsh/init.zsh | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/cli/zsh/default.nix b/modules/cli/zsh/default.nix index 54aa476..8c43ec5 100644 --- a/modules/cli/zsh/default.nix +++ b/modules/cli/zsh/default.nix @@ -226,6 +226,13 @@ ]; initExtra = builtins.readFile ./init.zsh; + initExtraFirst = '' + # Create a new tmux session (with a random name) and attach. + if [[ -z "$TMUX" ]]; then + exec tmux new-session -s "$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)" + fi + ''; + # zprof.enable = true; sessionVariables = { diff --git a/modules/cli/zsh/init.zsh b/modules/cli/zsh/init.zsh index cbdccaf..dd0523b 100644 --- a/modules/cli/zsh/init.zsh +++ b/modules/cli/zsh/init.zsh @@ -1,8 +1,3 @@ -# Create a new tmux session (with a random name) and attach. -if [[ -z "$TMUX" ]]; then - exec tmux new-session -s "$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)" -fi - # This speeds up pasting w/ autosuggest # https://github.com/zsh-users/zsh-autosuggestions/issues/238 pasteinit() {