From f3b3d6c0efd0e646108dbeeb8a4845dbf47e6252 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Nov 2022 22:37:46 +0530 Subject: [PATCH] Workaround for mypy bug --- kitty/window.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/window.py b/kitty/window.py index 3ae988c6d..0310bbb51 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -94,7 +94,7 @@ class CwdRequest: if reported_cwd and not window.child_is_remote and (self.request_type is CwdRequestType.last_reported or window.at_prompt): return reported_cwd if self.request_type is CwdRequestType.root: - return window.child.current_cwd or '' + return window.get_cwd_of_root_child() or '' return window.get_cwd_of_child(oldest=self.request_type is CwdRequestType.oldest) or '' def modify_argv_for_launch_with_cwd(self, argv: List[str]) -> str: @@ -1388,6 +1388,9 @@ class Window: def get_cwd_of_child(self, oldest: bool = False) -> Optional[str]: return self.child.get_foreground_cwd(oldest) or self.child.current_cwd + def get_cwd_of_root_child(self) -> Optional[str]: + return self.child.current_cwd + @property def cwd_of_child(self) -> Optional[str]: return self.get_cwd_of_child()