terminal: Log selected shell (#39295)
It is useful to double check in the logs which shell program is used by Zed's terminal. Release Notes: - N/A
This commit is contained in:
@@ -378,31 +378,40 @@ impl TerminalBuilder {
|
||||
title_override: Option<SharedString>,
|
||||
}
|
||||
|
||||
impl ShellParams {
|
||||
fn new(
|
||||
program: String,
|
||||
args: Option<Vec<String>>,
|
||||
title_override: Option<SharedString>,
|
||||
) -> Self {
|
||||
log::info!("Using {program} as shell");
|
||||
Self {
|
||||
program,
|
||||
args,
|
||||
title_override,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let shell_params = match shell.clone() {
|
||||
Shell::System => {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
Some(ShellParams {
|
||||
program: util::get_windows_system_shell(),
|
||||
..Default::default()
|
||||
})
|
||||
Some(ShellParams::new(
|
||||
util::get_windows_system_shell(),
|
||||
None,
|
||||
None,
|
||||
))
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
None
|
||||
}
|
||||
Shell::Program(program) => Some(ShellParams {
|
||||
program,
|
||||
..Default::default()
|
||||
}),
|
||||
Shell::Program(program) => Some(ShellParams::new(program, None, None)),
|
||||
Shell::WithArguments {
|
||||
program,
|
||||
args,
|
||||
title_override,
|
||||
} => Some(ShellParams {
|
||||
program,
|
||||
args: Some(args),
|
||||
title_override,
|
||||
}),
|
||||
} => Some(ShellParams::new(program, Some(args), title_override)),
|
||||
};
|
||||
let terminal_title_override = shell_params.as_ref().and_then(|e| e.title_override.clone());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user