Variable: ghostel-macos-login-shell
ghostel-macos-login-shell is a customizable variable defined in
ghostel-shell.el.
Value
nil
Documentation
Wrap shell invocations on macOS so the shell starts as a login shell.
When non-nil and system-type is darwin, ghostel wraps the shell
spawned by ghostel--start-process with /usr/bin/login -flp $USER
followed by a tiny /bin/bash --noprofile --norc -c "exec -l <shell>
[args]" shim. This mirrors Apple's Terminal.app and Ghostty so that
per-user login files (~/.zprofile, ~/.bash_profile) are sourced as
users expect on macOS.
When ~/.hushlogin exists, -q is passed to login(1) to suppress
its banner. The wrap preserves the calling environment via login -p,
so ghostel's shell-integration env (ZDOTDIR, ENV, XDG_DATA_DIRS,
EMACS_GHOSTEL_PATH, INSIDE_EMACS) reaches the final shell. Note that
login(1) ALWAYS resets HOME, SHELL, LOGNAME, USER, and MAIL from the
passwd entry — overrides for these in ghostel-environment do not
survive the wrap.
This wrap is only applied for the interactive shell spawned by
ghostel. It is not applied for ghostel-exec (the arbitrary-
command entry point), for remote (TRAMP) sessions, or on non-Darwin
platforms. Set to nil to opt out and get a plain (non-login)
interactive shell.
Source Code
;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-shell.el
(defcustom ghostel-macos-login-shell (eq system-type 'darwin)
"Wrap shell invocations on macOS so the shell starts as a login shell.
When non-nil and `system-type' is `darwin', ghostel wraps the shell
spawned by `ghostel--start-process' with `/usr/bin/login -flp $USER'
followed by a tiny `/bin/bash --noprofile --norc -c \"exec -l <shell>
[args]\"' shim. This mirrors Apple's Terminal.app and Ghostty so that
per-user login files (`~/.zprofile', `~/.bash_profile') are sourced as
users expect on macOS.
When `~/.hushlogin' exists, `-q' is passed to `login(1)' to suppress
its banner. The wrap preserves the calling environment via `login -p',
so ghostel's shell-integration env (ZDOTDIR, ENV, XDG_DATA_DIRS,
EMACS_GHOSTEL_PATH, INSIDE_EMACS) reaches the final shell. Note that
login(1) ALWAYS resets HOME, SHELL, LOGNAME, USER, and MAIL from the
passwd entry — overrides for these in `ghostel-environment' do not
survive the wrap.
This wrap is only applied for the interactive shell spawned by
`ghostel'. It is not applied for `ghostel-exec' (the arbitrary-
command entry point), for remote (TRAMP) sessions, or on non-Darwin
platforms. Set to nil to opt out and get a plain (non-login)
interactive shell."
:type 'boolean
:group 'ghostel)