From 54ad4fc63b3057f998f11abdf11bb1a8035aa614 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 Aug 2025 09:14:46 +0530 Subject: [PATCH] zsh shell integration: run startup command before any prompt/exec marking is done and set window title to the command being run --- shell-integration/zsh/kitty-integration | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell-integration/zsh/kitty-integration b/shell-integration/zsh/kitty-integration index eefcdf6e0..6f9d83049 100644 --- a/shell-integration/zsh/kitty-integration +++ b/shell-integration/zsh/kitty-integration @@ -350,6 +350,12 @@ _ksi_deferred_init() { fi done + # run startup command + if [[ -n "$krcs" ]]; then + builtin print -nu "$_ksi_fd" -f '\e]2;%s\e\\' "$krcs" + builtin eval "$krcs" + fi + if (( $+functions[_ksi_preexec] )); then builtin typeset -ag preexec_functions preexec_functions+=(_ksi_preexec) @@ -427,8 +433,6 @@ _ksi_deferred_init() { # to unfunction themselves when invoked. Unfunctioning is done by calling code. builtin unfunction _ksi_deferred_init - # run startup command - if [[ -n "$krcs" ]]; then builtin eval "$krcs"; fi } _ksi_transmit_data() {