Restrict /proc cwd lookup to Linux

This commit is contained in:
Nicolas Danelon 2026-04-24 17:49:59 +02:00
parent 285556e3dc
commit 7051cc53f7

View file

@ -415,12 +415,13 @@ impl Terminal {
}
pub fn working_directory(&self) -> Option<PathBuf> {
#[cfg(not(windows))]
#[cfg(target_os = "linux")]
{
let shell_pid = self.shell_pid?;
fs::read_link(format!("/proc/{shell_pid}/cwd")).ok()
}
#[cfg(windows)]
#[cfg(not(target_os = "linux"))]
{
None
}