diff --git a/modules/cli/zsh/default.nix b/modules/cli/zsh/default.nix index 3b1ab75..f54df5e 100644 --- a/modules/cli/zsh/default.nix +++ b/modules/cli/zsh/default.nix @@ -119,6 +119,17 @@ } trap __onExit EXIT fi + + # execute arbitrary commands on startup since `zsh -sc` is not a real option :c + if [[ -n CMD ]]; then + # unset the cmd before executing it (for long processes) + cmd=$CMD + unset CMD + if [[ -n $TMUX ]]; then + tmux set-environment -r CMD + fi + eval $cmd + fi ''; initExtraBeforeCompInit = builtins.readFile ./comp.zsh; completionInit = diff --git a/modules/cli/zsh/init.zsh b/modules/cli/zsh/init.zsh index d56971c..7c8c6f2 100644 --- a/modules/cli/zsh/init.zsh +++ b/modules/cli/zsh/init.zsh @@ -158,14 +158,3 @@ proxy() { # disable space between right prompt and end of line ZLE_RPROMPT_INDENT=0 - -# execute arbitrary commands on startup since `zsh -sc` is not a real option :c -if [[ -n CMD ]]; then - # unset the cmd before executing it (for long processes) - cmd=$CMD - unset CMD - if [[ -n $TMUX ]]; then - tmux set-environment -r CMD - fi - eval $cmd -fi