Run CMD command (for tmux session) before zsh init

This commit is contained in:
2025-03-07 16:02:03 +01:00
parent a21b64f0d4
commit 6350e31036
2 changed files with 11 additions and 11 deletions
+11
View File
@@ -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 =
-11
View File
@@ -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