Restrict /proc cwd lookup to Linux
This commit is contained in:
parent
285556e3dc
commit
7051cc53f7
1 changed files with 3 additions and 2 deletions
|
|
@ -415,12 +415,13 @@ impl Terminal {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn working_directory(&self) -> Option<PathBuf> {
|
pub fn working_directory(&self) -> Option<PathBuf> {
|
||||||
#[cfg(not(windows))]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
let shell_pid = self.shell_pid?;
|
let shell_pid = self.shell_pid?;
|
||||||
fs::read_link(format!("/proc/{shell_pid}/cwd")).ok()
|
fs::read_link(format!("/proc/{shell_pid}/cwd")).ok()
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
{
|
{
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue