1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

Use configured default program when running subcommand "start" with CWD option set and program unset

closes: https://github.com/wez/wezterm/pull/851
This commit is contained in:
kas 2021-06-03 23:15:32 +02:00 committed by Wez Furlong
parent 4feefdd04a
commit 4fcfb4b222

View File

@ -325,11 +325,9 @@ fn run_terminal_gui(opts: StartCommand) -> anyhow::Result<()> {
let need_builder = !opts.prog.is_empty() || opts.cwd.is_some();
let cmd = if need_builder {
let mut builder = if opts.prog.is_empty() {
CommandBuilder::new_default_prog()
} else {
CommandBuilder::from_argv(opts.prog)
};
let config = config::configuration();
let prog = opts.prog.iter().map(|s| s.as_os_str()).collect::<Vec<_>>();
let mut builder = config.build_prog(if prog.is_empty() { None } else { Some(prog) })?;
if let Some(cwd) = opts.cwd {
builder.cwd(cwd);
}