-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Special Treatment of MANPATH broken #4158
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
Comments
I did not know MANPATH worked like that. It also appears POSIX (in their infinite wisdom) has not standardized MANPATH on purpose, so there's nothing to rely on here - maybe e.g. mandoc doesn't do this. I would expect that, to get the default value appended, I'd have to actually append it - i.e. set MANPATH like Note that adding a ":" element also works - The annoying thing here is that the solution for #2106 has some desirable properties - it makes code like The question is what we should do about this, and (as always) I have a few options in mind:
Personally, I'm leaning towards the former. If you really want this (rather obscure) feature, set a |
My apologies for the breakage. The BSD |
Thanks for the quick reply. I agree that the special colon semantics of |
I'm going to remove |
For fish 2.6.0 here is a workaround when trying to use a MANPATH variable that has already been set to something before fish was started, e.g. # replaces dot elements in the $MANPATH array with colons
# because fish 2.6.0 will split MANPATH by colons into an array.
#
# This helps the command "manpath" on a GNU system to find the default manpages
#
# It is not perfect: there may be too many colons in the final manpath
# but this is considered to be a non-issue, as this is the place where the
# system config path elements should be inserted anyway and once the current
# directory is included it does not hurt to include it again.
#
# future fish shells (version 3?) may provide a better solution here
# see https://github.com/fish-shell/fish-shell/issues/2090
# https://github.com/fish-shell/fish-shell/issues/4158
for i in (seq 1 (count $MANPATH))
if test $MANPATH[$i] = .
set MANPATH[$i] :
end
end |
Hi,
I noticed that with Fish 2.6 my man pages are not working as expected with Ubuntu 16.04.2 (no idea for other distros).
For the
MANPATH
environment variable, colons at the beginning, the end and double colons have special meaning. However, sinceMANPATH
is now converted to an array and empty array elements are no longer allowed,MANPATH
s that rely on the special meaning of the colon are no longer possible without hacky workarounds.Example:
In this example, I want to prepend my custom man page locations to the man search path, so
MANPATH
should end with:
Actual Behavior:
Expected Behavior:
The problem occurs as empty array elements are replaced with
.
for the current directory.This behavior was already discussed in Issue 2106. Not sure if that makes sense for
MANPATH
, though.Hacky Workaround:
If done carefully, the workaround works for my use cases but it is probably not a nice solution :-(
The text was updated successfully, but these errors were encountered: