1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 06:54:45 +03:00

Always provide an absolute path for the working directory to CreateProcessW()

This commit is contained in:
kas 2021-07-19 09:38:01 +02:00 committed by Wez Furlong
parent 5904140abf
commit 91ae9bcbaf

View File

@ -243,7 +243,17 @@ impl CommandBuilder {
dir.map(|dir| {
let mut wide = vec![];
wide.extend(dir.encode_wide());
if Path::new(dir).is_relative() {
if let Ok(ccwd) = std::env::current_dir() {
wide.extend(ccwd.join(dir).as_os_str().encode_wide());
} else {
wide.extend(dir.encode_wide());
}
} else {
wide.extend(dir.encode_wide());
}
wide.push(0);
wide
})