Dont use remote cwd as child cwd

This commit is contained in:
Kovid Goyal
2022-03-17 16:42:11 +05:30
parent f6edb774fc
commit d57abb56ce

View File

@@ -1165,12 +1165,20 @@ class Window:
@property
def cwd_of_child(self) -> Optional[str]:
if self.at_prompt and self.screen.last_reported_cwd:
if self.at_prompt and self.screen.last_reported_cwd and not self.child_is_remote:
cwd = path_from_osc7_url(self.screen.last_reported_cwd)
if cwd:
return cwd
return self.child.foreground_cwd or self.child.current_cwd
@property
def child_is_remote(self) -> bool:
for p in self.child.foreground_processes:
q = list(p['cmdline'] or ())
if q and q[0].lower() == 'ssh':
return True
return False
def modify_argv_for_launch_with_cwd(self, argv: List[str]) -> str:
if argv[0] != resolved_shell(get_options())[0] or not self.screen.last_reported_cwd:
return self.cwd_of_child or ''