settings_ui: Don't show sh as default shell on windows (#43276)

Closes #ISSUE

Release Notes:

- Fixed an issue in the settings UI where changing the terminal shell
would set the default shell to `sh` on Windows
This commit is contained in:
Ben Kunkle
2025-11-23 16:52:50 -05:00
committed by GitHub
parent da143c5527
commit 34a2e1d56b
+7 -2
View File
@@ -4577,6 +4577,11 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
.project
.shell
.get_or_insert_with(|| settings::Shell::default());
let default_shell = if cfg!(target_os = "windows") {
"powershell.exe"
} else {
"sh"
};
*settings_value = match value {
settings::ShellDiscriminants::System => {
settings::Shell::System
@@ -4585,7 +4590,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
let program = match settings_value {
settings::Shell::Program(p) => p.clone(),
settings::Shell::WithArguments { program, .. } => program.clone(),
_ => String::from("sh"),
_ => String::from(default_shell),
};
settings::Shell::Program(program)
},
@@ -4595,7 +4600,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
settings::Shell::WithArguments { program, args, title_override } => {
(program.clone(), args.clone(), title_override.clone())
},
_ => (String::from("sh"), vec![], None),
_ => (String::from(default_shell), vec![], None),
};
settings::Shell::WithArguments {
program,