19 Commits

Author SHA1 Message Date
hyuraku
67c5006b0a cmd/shellenv.sh: repair style and set HOMEBREW_CASK_REPOSITORY 2021-04-28 20:47:39 +09:00
Z. Grace Moreau
a257d046ef remove spurious call to $fish_pid 2021-01-18 11:20:11 -07:00
Z. Grace Moreau
0dbd4157be query fish's PID correctly; also output executable names only 2021-01-17 14:25:09 -07:00
Tim Dorr
45368c8119 Add a default back to INFOPATH
It looks like #7738 removed the default unintentionally. This adds it back. 

For scripts that `set -u`, this will fail if $INFOPATH is not already set (`INFOPATH: unbound variable`). This provides an empty default, but one that will still satisfy the trailing colon requirement.
2020-07-19 13:37:52 +10:00
Adrian Ho
c166667666 shellenv: Fix shell detection
It currently switches on `$SHELL`, which points to the user's login shell. However, `shellenv` may be used in contexts where the running shell isn't `$SHELL` (e.g. csh-based `cron` scripts), and Linux desktop environments may set up user sessions in ways that trip up the current algorithm (see #7965 for an example). To work correctly in all circumstances and environments, its output should be determined by the context (calling shell) instead.

Fixes #7965.
2020-07-11 22:28:27 +08:00
Dan Kessler
30b04daa8a append colon (:) to end of brew's part of INFOPATH in brew shellenv
The behavior of some programs (e.g., emacs) differs depending on
whether INFOPATH is terminated in a colon or not. For example, the
info viewer built into emacs has a default list of places from which
it will draw info files, and it will only check this if either (a)
INFOPATH is unset, or (b) INFOPATH ends in a colon.

Currently brew shellenv prepends to the existing $INFOPATH and will
separate with a colon if $INFOPATH already exists, but if it does not
it will not terminate in a colon. As a result, info
pages (like emacs and elisp) are missing from the info viewer.

The existing brew shellenv logic used a parameter expansion trick to
include a colon only if it was prepending to an extant INFOPATH, but
because we want brew's contribution to the INFOPATH to always end in a
colon (whether there's an existing INFOPATH or not), we don't have to
use the parameter expansion trick

This commit only changes behavior for "other" shells (i.e., not fish,
csh, or tcsh) since I don't know how to append a colon to variables in
these shells.
2020-06-12 20:47:43 -04:00
April Arcus
0b4febceaf fix undefined variable interpolation in tcsh 2020-05-25 10:46:10 -07:00
Shaun Jackman
133ee7966d shell: Use .profile unless .bash_profile exists 2020-05-13 09:30:02 -07:00
Mike McQuaid
c05b3a755f
shellenv: recommend .bash_profile
Fixes #7516
2020-05-07 10:34:59 +01:00
Niklas Herder
2f4d4b8684
[fix] Improve shell detection in shellenv
$SHELL is set to only the binary name in some environments (e.g. fish, not /usr/bin/fish), causing detection of fish/csh/tsch to fail without this change.
2020-04-29 08:20:06 +02:00
Charles Gould
871974650b shellenv: use PATH variable, fish_user_paths should remain universal in scope 2020-03-26 09:38:25 -05:00
Chih-Pin Tan
7741672ecd Changes to be committed:
modified:   Library/Homebrew/cmd/shellenv.sh

Prevent overriding default MANPATH while MANPATH is empty.
2019-10-31 12:25:58 +00:00
Markus Reiter
59866d25ea Fix shellenv when using -u. 2019-10-17 20:14:01 +02:00
EricFromCanada
a9d1457c05 shellenv: suggest .zprofile for zsh users 2019-08-20 12:54:44 -04:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
なつき
193ead3c0c
fish 2.x support for brew shellenv 2019-02-21 17:54:29 -08:00
なつき
50ba2ad93f Support different shells for brew shellenv 2019-02-20 10:21:55 +00:00
Mike McQuaid
2a676dd94c
shellenv: improve --help formatting. 2019-01-30 21:38:45 +00:00
Mike McQuaid
44bcf69d1f
cmd/shellenv: use Bash.
This speeds up execution by 3x on my machine and the script is simple
enough to warrant this.
2018-09-13 09:27:44 +01:00