diff --git a/docs/changelog.markdown b/docs/changelog.markdown index 4ca0d1267..782d002a0 100644 --- a/docs/changelog.markdown +++ b/docs/changelog.markdown @@ -10,6 +10,12 @@ daily) from the master branch. It may not be usable and the feature set may change. As features stabilize some brief notes about them may accumulate here. +* Unix: We now default to spawning shells with the `-l` argument to request a login + shell. This is important on macOS where the default GUI environment doesn't + source a working PATH from the shell, resulting in an anemic PATH unless the + user has taken care to cover this in their shell startup. `-l` works to enable + a login shell in `zsh`, `bash`, `fish` and `tcsh`. If it doesn't work with your + shell, you can use the `default_prog` configuration option to override this. * We now accept `rgb:XX/XX/XX` color syntax for OSC 4 and related escape sequences; previously only `#XXXXXX` and named colors were accepted. * We now accept OSC 104 to reset custom colors to their defaults. diff --git a/pty/src/cmdbuilder.rs b/pty/src/cmdbuilder.rs index 02b48f736..afdba7328 100644 --- a/pty/src/cmdbuilder.rs +++ b/pty/src/cmdbuilder.rs @@ -116,6 +116,12 @@ impl CommandBuilder { pub(crate) fn as_command(&self) -> anyhow::Result { let mut cmd = if self.is_default_prog() { let mut cmd = std::process::Command::new(&Self::get_shell()?); + // Run the shell as a login shell. This is a little shaky; it just + // happens to be the case that bash, zsh, fish and tcsh use -l + // to indicate that they are login shells. Ideally we'd just + // tell the command builder to prefix argv[0] with a `-`, but + // Rust doesn't support that. + cmd.arg("-l"); let home = Self::get_home_dir()?; let dir: &OsStr = self .cwd