2

I love the fish shell. It makes perfect sense to me, but there's one problem I've been having.

No matter what I try, I can't get man to work. When I type

man ls

for example, I get No manual entry for ls. Same for every other command.

On bash, of course, this would show the man page. My MANPATH environment variable is set (points to /opt/local/share/man/) which contains exactly the files I would expect.

Any help?

Thomas Jay Rush
  • 401
  • 4
  • 12
  • show the output of `type -a man` – glenn jackman Dec 11 '19 at 14:05
  • Also the operating system and fish version would be good to know. Fish overrides man with a function to insert its own man pages, and that used to have some issues, especially on non-mainstream-linux OSen. – faho Dec 11 '19 at 14:11
  • ``` # Defined in /Users/jrush/.config/fish/functions/man.fish @ line 1 function man --description 'Format and display manual pages' set -q man_blink and set -l blink (set_color $man_blink) or set -l blink (set_color -o red) < ... removed code > command man $argv end man is /usr/bin/man ``` – Thomas Jay Rush Dec 11 '19 at 18:24
  • Mac operating system fish --version fish, version 3.0.2 – Thomas Jay Rush Dec 11 '19 at 18:24
  • The output of `man -w`, and `stat /opt/local/share/man/man1/ls.1`, would be useful. – Zanchey Dec 12 '19 at 06:53
  • man -w: `/usr/local/Cellar/fish/3.0.2/share/fish/man:/opt/local/share/man/` – Thomas Jay Rush Dec 12 '19 at 13:25
  • stat: `/opt/local/share/man/man1/ls.1: stat: No such file or directory` – Thomas Jay Rush Dec 12 '19 at 13:26

1 Answers1

3

Your problem is that you have defined MANPATH without including any of the system manual directories, so man will not search them.

Instead, set MANPATH to /opt/local/share/man:, which will prepend that directory to the system-determined paths (this is not well-documented in the macOS manual page for man).

For example:

> env MANPATH="/opt:" man -w
/opt:/usr/local/share/man:/usr/share/man:/opt/X11/share/man:/Library/Frameworks/Mono.framework/Versions/Current/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
> env MANPATH="/opt" man -w
/opt
Zanchey
  • 1,941
  • 1
  • 15
  • 23