From 7d9cf0b064c54a268a555ac26d99d0cad1b074e5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Mar 2022 21:16:49 +0530 Subject: [PATCH] When at shell prompt use reported cwd --- kitty/window.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kitty/window.py b/kitty/window.py index e1b0adacd..bdfb7158e 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -1137,6 +1137,10 @@ class Window: @property def cwd_of_child(self) -> Optional[str]: + if self.at_prompt and self.screen.last_reported_cwd: + cwd = path_from_osc7_url(self.screen.last_reported_cwd) + if cwd: + return cwd return self.child.foreground_cwd or self.child.current_cwd def modify_argv_for_launch_with_cwd(self, argv: List[str]) -> str: