File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -204,10 +204,21 @@ pub async fn default_user_shell() -> Shell {
204204 if cfg ! ( windows) {
205205 get_shell ( ShellType :: PowerShell , None ) . unwrap_or ( Shell :: Unknown )
206206 } else {
207- get_user_shell_path ( )
207+ let user_default_shell = get_user_shell_path ( )
208208 . and_then ( |shell| detect_shell_type ( & shell) )
209- . and_then ( |shell_type| get_shell ( shell_type, None ) )
210- . unwrap_or ( Shell :: Unknown )
209+ . and_then ( |shell_type| get_shell ( shell_type, None ) ) ;
210+
211+ let shell_with_fallback = if cfg ! ( target_os = "macos" ) {
212+ user_default_shell
213+ . or_else ( || get_shell ( ShellType :: Zsh , None ) )
214+ . or_else ( || get_shell ( ShellType :: Bash , None ) )
215+ } else {
216+ user_default_shell
217+ . or_else ( || get_shell ( ShellType :: Bash , None ) )
218+ . or_else ( || get_shell ( ShellType :: Zsh , None ) )
219+ } ;
220+
221+ shell_with_fallback. unwrap_or ( Shell :: Unknown )
211222 }
212223}
213224
You can’t perform that action at this time.
0 commit comments