-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty lines in /etc/paths.d cause . to appear in PATH on macOS Mojave #5809
Comments
Can reproduce. |
There is a small problem with the logic causing empty elements to be put into $PATH for empty lines. And I did not know this until now but we translate these to /// Ensure the content of the magic path env vars is reasonable. Specifically, that empty path
/// elements are converted to explicit "." to make the vars easier to use in fish scripts.
static void init_path_vars() {
// Do not replace empties in MATHPATH - see #4158.
fix_colon_delimited_var(L"PATH", env_stack_t::globals());
fix_colon_delimited_var(L"CDPATH", env_stack_t::globals());
} |
I don't understand this business of sticking |
Oh, I didn't realize that empty $PATH components usually are equivalent to |
Does the official path_helper thing handle this in the same way? |
Yes. Blank lines are ignored. |
I recently discovered that my PATH contains a
.
between the default paths of macOS from /etc/paths*:One of the files in /etc/paths.d contains empty lines (/etc/paths.d/TeX to be specific):
When I manually remove these empty lines, the dot doesn't appear in PATH anymore:
fish version, installed via Homebrew:
TERM: xterm-256color
macOS Mojave 10.14.4 (18E226)
Terminal: iTerm2 Build 3.3.0beta2
The text was updated successfully, but these errors were encountered: