Workaround for mypy bug

This commit is contained in:
Kovid Goyal 2022-11-15 22:37:46 +05:30
parent 0c0b9e6b9c
commit f3b3d6c0ef
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -94,7 +94,7 @@ def cwd_of_child(self) -> str:
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 @@ def cmd_output(self, which: CommandOutput = CommandOutput.last_run, as_ansi: boo
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()