You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
activate.fish leaves a literal ^/dev/null entry in PATH #400
bin/activate.fish appends a bogus ^/dev/null element to PATH. Every
fish user of nodeenv gets it. The same one-line bug also defeats the stderr
suppression the line was written for.
Observed in CI on ubuntu-latest as a fourth PATH entry resolving to <cwd>/^/dev/null.
Cause
ACTIVATE_FISH ends its PATH line with a caret redirect:
# The node_modules/.bin path doesn't exists and it will print a warning, and# that's why we redirect stderr to /dev/null :)set-gx PATH "$NODE_VIRTUAL_ENV/lib/node_modules/.bin""$NODE_VIRTUAL_ENV/__BIN_NAME__"$PATH^/dev/null
fish 3.0 introduced the stderr-nocaret feature flag and ^ stopped being
a stderr redirect; it is now an ordinary character. So ^/dev/null is
parsed as one more argument to set and lands in PATH.
Two consequences, not one:
PATH gains an entry that does not exist.
The warning the redirect was meant to hide now reaches stderr, so the
comment above the line no longer describes what happens.
nodeenv.py uses the same ^/dev/null syntax once more, inside freeze:
set-g NPM_LIST (npm list installed active >/dev/null ^/dev/null |\cut-d''-f 1 |grep-v npm)
Both should be fixed together. The modern spelling is 2>/dev/null.
Test coverage
tests/test_activate_shells.py (added in #397) marks this xfail(strict=True) as FISH_CARET_REDIRECT on test_activate_sets_env,
via the path_shell decorator. When the fix lands, drop the constant and the
decorator and put the test back on @activating_shell.
Worth noting how it surfaced: the test originally asserted only the first two PATH entries, which hid this completely and let CI report green. Widening
it to compare the whole list caught the bug on the first run. A regression
anywhere past index 1 was previously invisible.
Activity
fix: stop putting ^/dev/null on PATH in activate.fish
fix: stop putting ^/dev/null on PATH in activate.fish
fix(nodeenv): stop putting ^/dev/null on PATH in activate.fish