fix(pty): report no-cwd for empty path returned from sysinfo (#2213)

This commit is contained in:
Aram Drevekenin 2023-03-01 12:25:13 +01:00 committed by GitHub
parent 3057ec434b
commit d670c29649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -722,8 +722,12 @@ impl ServerOsApi for ServerOsInputOutput {
system_info.refresh_processes_specifics(ProcessRefreshKind::default());
if let Some(process) = system_info.process(pid.into()) {
let cwd = process.cwd();
let cwd_is_empty = cwd.iter().next().is_none();
if !cwd_is_empty {
return Some(process.cwd().to_path_buf());
}
}
None
}