Implement --cwd=last_reported

This commit is contained in:
Kovid Goyal
2022-03-17 10:29:31 +05:30
parent 72b1996423
commit afa6128155
2 changed files with 10 additions and 1 deletions

View File

@@ -78,6 +78,10 @@ class CwdRequest:
@property
def cwd_of_child(self) -> Optional[str]:
window = get_boss().window_id_map.get(self.window_id)
if window and self.request_type is CwdRequestType.last_reported and window.screen.last_reported_cwd:
cwd = path_from_osc7_url(window.screen.last_reported_cwd)
if cwd:
return cwd
return window.cwd_of_child if window else None