Skip to main content

default_shell

Function default_shell 

Source
pub fn default_shell() -> PathBuf
Expand description

The user’s default shell, as Ghostty picks it with no command set.

In a command-line environment, one with TERM_PROGRAM set, it is $SHELL. Otherwise, such as an application opened from the Dock or the Finder, $SHELL is whatever the launcher had, so the shell comes from the user’s passwd entry instead. Then /bin/sh.

Windows has no $SHELL, and Ghostty does not run there, so it follows herdr: the first pwsh.exe on PATH, as a full path, which is what other Windows terminals prefer, else powershell.exe, which every Windows has.