fix: add condition for existence of current_dir (#995)

This commit is contained in:
Jae-Heon Ji 2022-01-09 18:18:03 +09:00 committed by GitHub
parent 690af2e33d
commit d2cfcb3bab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,8 +113,10 @@ fn handle_openpty(
let mut child = unsafe {
let command = &mut Command::new(cmd.command);
if let Some(current_dir) = cmd.cwd {
if current_dir.exists() {
command.current_dir(current_dir);
}
}
command
.args(&cmd.args)
.pre_exec(move || -> std::io::Result<()> {