Spawn login shells by default on unix systems

refs: https://github.com/wez/wezterm/issues/133
This commit is contained in:
Wez Furlong committed 2020-01-26 13:47:12 -08:00
1 parent 1fee3c11bb
commit 38b19cb7ea
2 files changed
+12

No files matched your search

+6
View File
@@ -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.
+6
View File
@@ -116,6 +116,12 @@ impl CommandBuilder {
pub(crate) fn as_command(&self) -> anyhow::Result<std::process::Command> {
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