From c0ea806afebcf8d4fb13ee8f642d3f405a4a8987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E7=99=BD?= <364772080@qq.com> Date: Fri, 23 Aug 2024 03:05:00 +0800 Subject: [PATCH] windows: Treat `pwsh` as `PowerShell` (#16409) `pwsh` is the newer version of `PowerShell`, while the one that comes pre-installed on Windows is called `Windows PowerShell` and is an older version. I have no idea why Microsoft dose this and not updated the `Windows Powershell` on Windows. Release Notes: - N/A --- crates/terminal_view/src/terminal_panel.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rs index e2725183b5..2fee3c88c3 100644 --- a/crates/terminal_view/src/terminal_panel.rs +++ b/crates/terminal_view/src/terminal_panel.rs @@ -886,7 +886,11 @@ fn to_windows_shell_variable(shell_type: WindowsShellType, input: String) -> Str #[cfg(target_os = "windows")] fn to_windows_shell_type(shell: &str) -> WindowsShellType { - if shell == "powershell" || shell.ends_with("powershell.exe") { + if shell == "powershell" + || shell.ends_with("powershell.exe") + || shell == "pwsh" + || shell.ends_with("pwsh.exe") + { WindowsShellType::Powershell } else if shell == "cmd" || shell.ends_with("cmd.exe") { WindowsShellType::Cmd