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
6 changed files with 35 additions and 2 deletions

View File

@@ -37,6 +37,8 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
end
set --erase SSH_KITTEN_KITTY_DIR
end
set --local krcs "$KITTY_SI_RUN_COMMAND_AT_STARTUP"
set --erase KITTY_SI_RUN_COMMAND_AT_STARTUP
# Enable cursor shape changes for default mode and vi mode
if not contains "no-cursor" $_ksi
@@ -201,6 +203,9 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
test (count $new_path) -eq (count $PATH)
or set --global --export --path PATH $new_path
end
if test -n "$krcs"
eval "$krcs"
end
end
function edit-in-kitty --wraps "kitten edit-in-kitty" -d "Edit the specified file in a kitty overlay window with your locally installed editor"