Fixed bug where setting the current directory was impossible on UNIX for non-default terminal commands
This commit is contained in:
1 parent
f64b268edd
commit
f2327de74d
1 file changed
+8
@@ -134,6 +134,14 @@ impl CommandBuilder {
|
||||
} else {
|
||||
let mut cmd = std::process::Command::new(&self.args[0]);
|
||||
cmd.args(&self.args[1..]);
|
||||
let home = Self::get_home_dir()?;
|
||||
let dir: &OsStr = self
|
||||
.cwd
|
||||
.as_ref()
|
||||
.map(|dir| dir.as_os_str())
|
||||
.filter(|dir| std::path::Path::new(dir).is_dir())
|
||||
.unwrap_or(home.as_ref());
|
||||
cmd.current_dir(dir);
|
||||
cmd
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user