From af8cb7c39d26b27f85acf4628e26285bbc59dc22 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 20 Aug 2025 08:42:33 +0530 Subject: [PATCH] Use foreground process only if shell integration reports we are not at a prompt --- kitty/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/window.py b/kitty/window.py index 85a4fa988..e81b84e9f 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -2017,8 +2017,8 @@ class Window: if self.creation_spec.cmd != resolved_shell(get_options()): cmd = self.creation_spec.cmd unserialize_data: dict[str, int | list[str] | str] = {'id': self.id} - if not cmd and ser_opts.use_foreground_process: - if not self.at_prompt and self.last_cmd_cmdline: + if not cmd and ser_opts.use_foreground_process and not self.at_prompt: + if self.last_cmd_cmdline: unserialize_data['cmd_at_shell_startup'] = self.last_cmd_cmdline elif self.child.pid != (pid := self.child.pid_for_cwd) and pid is not None: # we have a shell running some command