Add an env var that can be used to eval an expression at startup of shell

This will come in handy to implement serialization as session
with running of current foreground command.
This commit is contained in:
Kovid Goyal 2025-08-16 11:58:30 +05:30
parent 0fb1835af1
commit 337cbf1435
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
6 changed files with 35 additions and 2 deletions

View file

@ -121,6 +121,8 @@ _ksi_main() {
fi
builtin unset SSH_KITTEN_KITTY_DIR
fi
builtin local krcs="$KITTY_SI_RUN_COMMAND_AT_STARTUP"
builtin unset KITTY_SI_RUN_COMMAND_AT_STARTUP
_ksi_debug_print() {
# print a line to STDERR of parent kitty process
@ -351,6 +353,7 @@ _ksi_main() {
fi
fi
builtin unset KITTY_IS_CLONE_LAUNCH KITTY_CLONE_SOURCE_STRATEGIES
if [[ -n "$krcs" ]]; then builtin eval "$krcs"; fi
}
_ksi_main
builtin unset -f _ksi_main