You are not logged in.

#1 2026-04-02 17:08:51

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

/usr/bin/man broken for my user

When I type

man man

(or any other manpage) in a terminal, I get an empty pager (I guess, less) showing

Manual page man(1) byte 0/0 (END) (press h for help or q to quit)

.

With

man --pager=more man

I get no output but the exit code is 0.

The man-db package is installed and so is groff.  The man pages are all there below /usr/share/man/.

Interestingly,

sudo man man

works just fine, same for

man man

as root.
Oh, and I have a test user account on my system.  Man works fine for that user, too.

Even more interestingly, I can open all man pages within Emacs using the woman command but doing the same with the man command says "Can't find the 1 man manpage".  The difference is that the woman command in emacs opens the file in /usr/share/man/ and formats it using elisp whereas the man command invokes /usr/bin/man.

man --manpath=/usr/share/man man

also doesn't work for my user.  So it seems to find the man pages but just won't display them.

So it's certainly something in my user's config which broke /usr/bin/man but what could it be?  It's not that I have configurations relating to man, at least not knowingly.

Offline

#2 2026-04-02 17:13:35

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: /usr/bin/man broken for my user

You said /usr/bin/man in the title, did you actually try that, or are you always just running 'man' as in the post? If only the latter, what does `type -a man` show? How about `env`?

Last edited by Scimmia (2026-04-02 17:13:47)

Online

#3 2026-04-02 18:28:14

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

Yes, I've also tried /usr/bin/man man.  Same issue.

$ type -a man
man is /usr/bin/man

$ env | sort
ALTERNATE_EDITOR=
COLORTERM=truecolor
CVS_RSH=ssh
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEBUGINFOD_URLS=https://debuginfod.archlinux.org 
DISPLAY=:0
EDITOR=et
ELECTRON_OZONE_PLATFORM_HINT=wayland
GDK_BACKEND=wayland
GPG_TTY=/dev/pts/1
HG=/usr/bin/hg
HOME=/home/horn
HOME_PROFILE_SOURCED=1
INFOPATH=/usr/local/texlive/current/texmf-dist/doc/info:
INVOCATION_ID=e04145f1f8bc41a8817a373b4cf75938
_JAVA_AWT_WM_NONREPARENTING=1
JOURNAL_STREAM=9:12031
LANG=en_US.UTF-8
LC_MEASUREMENT=de_DE.utf8
LC_MONETARY=de_DE.utf8
LC_NUMERIC=de_DE.utf8
LC_PAPER=de_DE.utf8
LC_TIME=de_DE.utf8
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=horn
MAIL=/var/spool/mail/horn
MAKEFLAGS=-j4
MANAGERPID=977
MANAGERPIDFDID=978
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/niri.service/memory.pressure
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
MOTD_SHOWN=pam
MOZ_DBUS_REMOTE=1
MOZ_ENABLE_WAYLAND=1
NIRI_SOCKET=/run/user/1000/niri.wayland-1.1079.sock
PATH=/home/horn/.cargo/bin:/home/horn/.cargo/bin:/home/horn/.local/bin:/home/horn/bin:/home/horn/Repos/utils:/usr/local/texlive/current/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PWD=/home/horn
RUST_SRC_PATH=/home/horn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
SHELL=/usr/bin/fish
SHLVL=3
SSH_AUTH_SOCK=/home/horn/.gnupg/S.gpg-agent.ssh
STARSHIP_SESSION_KEY=1936178079355797
STARSHIP_SHELL=fish
SYSTEMD_EXEC_PID=1079
TERM=foot-direct
TEXEDIT=emacsclient -t +%d %s
TEXINPUTS=.:/home/horn/.TeX//:
USER=horn
_=/usr/bin/env
VISUAL=ec
WAYLAND_DISPLAY=wayland-1
XCURSOR_SIZE=24
XCURSOR_THEME=default
XDG_CURRENT_DESKTOP=niri
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_ID=1
XDG_SESSION_TYPE=wayland
XDG_VTNR=1

Offline

#4 2026-04-02 18:40:38

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: /usr/bin/man broken for my user

Ug, fish. I had to look up the syntax. Does it work after running `set -e LESSOPEN`?

Online

#5 2026-04-02 19:19:10

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

Nope, still the same.  It also won't work when running bash or zsh instead of fish.

What works is "busybox sh" and "man man" in there (except the pager there cannot handle the escape sequences).

Last edited by tsdh (2026-04-02 19:21:50)

Offline

#6 2026-04-02 19:20:56

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

man --pager=more man # I get no output but the exit code is 0.

I have a test user account on my system.  Man works fine for that user, too.

What does that users environment look like?

Does

man -H firefox man

work?

Broadsword:

strace -f -o /tmp/man.strace man man

Offline

#7 2026-04-02 19:32:38

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

Env is already above.

Yeah, "man --html=firefox-developer-edition man" works fine. But

❯ man -H firefox-developer-edition man                                                  
No manual entry for firefox-developer-edition
man: no browser configured, so cannot show HTML output

stracre revealed something interesting:

45706 read(0, "o\n.B cat\nif\n.B less\nis not found"..., 4096) = 4096
45706 read(0, "nr 3supbot 0\n.      mk #T\n.    \\"..., 4096) = 4096
45706 read(0, "\n.ls\n.vs\n\\*[3trans].nr 3brule 0\n"..., 4096) = 4096
45706 read(0, "ocessors.\nSome of the preprocess"..., 4096) = 4096
45706 read(0, "its value will be used as the de"..., 4096) = 4096
45706 read(0, "ages may be available in other f"..., 4096) = 834
45706 read(0, "", 4096)                 = 0
45706 mmap(NULL, 233472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5691de5000
45706 munmap(0x7f5691de5000, 233472)    = 0
45706 write(2, "- (line 2771): Unexpected end of"..., 239) = 239
45706 write(2, "source: Error while reading file"..., 47) = 47
45706 close(4)                          = 0
45706 ioctl(0, TCGETS2, 0x7ffddfb961c0) = -1 ENOTTY (Inappropriate ioctl for device)
45706 write(2, "fish: Unsupported use of '='. In"..., 99) = 99
45706 getpid()                          = 45706

I got that strace while running "man man" in bash so I wonder where that "fish: Unsupported use of '='" comes from.  But that's at least a clue!

Offline

#8 2026-04-02 19:39:45

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

Env is already above.

I meant of the unaffected testusuer

man -H=firefox-developer-edition man

?

strace shows a lot of stderr output?

man man 2>/tmp/man.stderr

Offline

#9 2026-04-02 19:56:18

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

Ah, here's the testuser env:

❯ su testuser                                                                           
Password: 
[testuser@thinkpad-t440p horn]$ env | sort
ALTERNATE_EDITOR=
COLORTERM=truecolor
CVS_RSH=ssh
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEBUGINFOD_URLS=https://debuginfod.archlinux.org 
DISPLAY=:0
EDITOR=et
ELECTRON_OZONE_PLATFORM_HINT=wayland
GDK_BACKEND=wayland
GPG_TTY=/dev/pts/2
HG=/usr/bin/hg
HOME=/home/testuser
HOME_PROFILE_SOURCED=1
INFOPATH=/usr/local/texlive/current/texmf-dist/doc/info:
INVOCATION_ID=e04145f1f8bc41a8817a373b4cf75938
_JAVA_AWT_WM_NONREPARENTING=1
JOURNAL_STREAM=9:12031
LANG=en_US.UTF-8
LC_MEASUREMENT=de_DE.utf8
LC_MONETARY=de_DE.utf8
LC_NUMERIC=de_DE.utf8
LC_PAPER=de_DE.utf8
LC_TIME=de_DE.utf8
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=testuser
MAIL=/var/spool/mail/horn
MAKEFLAGS=-j4
MANAGERPID=977
MANAGERPIDFDID=978
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/niri.service/memory.pressure
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
MOTD_SHOWN=pam
MOZ_DBUS_REMOTE=1
MOZ_ENABLE_WAYLAND=1
NIRI_SOCKET=/run/user/1000/niri.wayland-1.1079.sock
PATH=/home/horn/.cargo/bin:/home/horn/.cargo/bin:/home/horn/.local/bin:/home/horn/bin:/home/horn/Repos/utils:/usr/local/texlive/current/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PWD=/home/horn
RUST_SRC_PATH=/home/horn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
SHELL=/bin/bash
SHLVL=3
SSH_AUTH_SOCK=/home/horn/.gnupg/S.gpg-agent.ssh
STARSHIP_SESSION_KEY=2477639564663213
STARSHIP_SHELL=fish
SYSTEMD_EXEC_PID=1079
TERM=foot-direct
TEXEDIT=emacsclient -t +%d %s
TEXINPUTS=.:/home/horn/.TeX//:
USER=testuser
_=/usr/bin/env
VISUAL=ec
WAYLAND_DISPLAY=wayland-1
XCURSOR_SIZE=24
XCURSOR_THEME=default
XDG_CURRENT_DESKTOP=niri
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_ID=1
XDG_SESSION_TYPE=wayland
XDG_VTNR=1

No, "man man" produces no output, not on stdout nor stderr.  But the strace contains a bit:

❯ grep 'write(2' /tmp/man.strace                                                                                           
45706 write(2, "Unable to open the current worki"..., 71) = 71
45709 write(2, "which: no zellij in (/home/horn/"..., 128) = 128
45709 write(2, "in:/home/horn/.local/bin:/home/h"..., 128) = 128
45709 write(2, "local/bin:/usr/bin:/usr/lib/jvm/"..., 104) = 104
45706 write(2, "- (line 2771): Unexpected end of"..., 239) = 239
45706 write(2, "source: Error while reading file"..., 47) = 47
45706 write(2, "fish: Unsupported use of '='. In"..., 99) = 99

The "which: no zellij..." probably comes from my ~/.config/fish/config.fish which contains

if which zellij > /dev/null 2>&1
    abbr -g z "zellij attach --create"
    abbr -g zl "zellij list-sessions"
    abbr -g zk "zellij kill-session"
    abbr -g zka "zellij kill-all-sessions"
end

But why would that run when I run "man man" in bash (which I invoked from fish)?
Where the others come from, I have no idea.

Offline

#10 2026-04-02 20:01:35

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

which I invoked from fish

strace -s 1024 -f -o /tmp/man.strace man man
cat /tmp/man.strace | nc termbin.com 9999 # this will upload the strace to termbin

Offline

#11 2026-04-02 20:12:47

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

https://termbin.com/yd5f

There's a "called on line 61 of file ~/.config/fish/config.fish" in there where line 61 is:

set -l host_cfg_file ~/.config/fish/config_(hostnamectl hostname).fish
if test -f $host_cfg_file
    source $host_cfg_file # this is line 61
end

and $host_cfg_file is a file which contains just commented code...

Offline

#12 2026-04-02 20:21:08

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

54334 execve("/usr/bin/fish", ["/usr/bin/fish", "-c", "prog=${0##*/}"], 0x55f47b488d30 /* 61 vars */) = 0

Looks like nroff (or man) runs a subshell using $SHELL
----
Edit: which falls flat

54334 write(2, "fish: Unsupported use of '='. In fish, please use 'set prog ${0##*/}'.\nprog=${0##*/}\n^~~~~~~~~~~~^\n", 99) = 99
54334 getpid()                          = 54334
54334 sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
54334 munmap(0x7f77e1974000, 12288)     = 0
54334 exit_group(127 <unfinished ...>
54336 <... poll resumed> <unfinished ...>) = ?
54335 <... futex resumed>)              = ?
54334 <... exit_group resumed>)         = ?
54336 +++ exited with 127 +++
54335 +++ exited with 127 +++
54334 +++ exited with 127 +++

regardless of the questionable config, ""prog=${0##*/}"" apparently already doesn't work.
---

SHELL=/usr/bin/bash man man

Last edited by seth (2026-04-02 20:29:49)

Offline

#13 2026-04-02 20:37:13

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

That's a bug or isn't it?  You cannot assume SHELL is bash, can you?

Anyway, when I comment the block of code loading a host-specific $host_cfg_file, man works again.  The remaining stderr writes are:

]$ grep ' write(2' /tmp/man.strace 
60680 write(2, "Unable to open the current working directory: Function not implemented\n", 71) = 71
60683 write(2, "which: no zellij in (/home/horn/.cargo/bin:/home/horn/.cargo/bin:/home/horn/.local/bin:/home/horn/bin:/home/horn/Repos/utils:/us", 128) = 128
60683 write(2, "r/local/texlive/current/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/us", 128) = 128
60683 write(2, "r/bin/vendor_perl:/usr/bin/core_perl)\n", 38) = 38
60680 write(2, "fish: Unsupported use of '='. In fish, please use 'set prog ${0##*/}'.\nprog=${0##*/}\n^~~~~~~~~~~~^\n", 99) = 99

Why not sourcing a file with just 5 commented lines is beyond me...

Offline

#14 2026-04-02 20:45:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

What does the file actually look like?
Don't you get any errors when running fish as interactive subshell?
Why does fish load any of this when not running as interactive shell tbw?

Offline

#15 2026-04-02 21:02:19

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

It's nroff.sh which contains

# Screen out shells non-conforming with POSIX Issue 4 (1994).
badshell=yes
# Solaris 10 /bin/sh is so wretched that it not only doesn't support
# standard parameter expansion, but it also writes diagnostic messages
# to the standard output instead of standard error.
if [ -n "$SHELL" ]
then
  "$SHELL" -c 'prog=${0##*/}' >/dev/null 2>&1 && badshell=
fi

if [ -n "$badshell" ]
then
  prog=`basename $0`
else
  prog=${0##*/}
fi

So basically it's only a test for non-POSIX shells like fish and should do no harm...

The $host_cfg_file is exactly this:

❯ cat ~/.config/fish/config_thinkpad-t440p.fish                                         
# if ! systemctl is-active --user niri.service && test \( -z "$WAYLAND_DISPLAY" \) -a \( /dev/tty1 = (tty) \)
#     #niri-session
#     #exec niri --session
#     #exec sway-wrapper.sh
# end

I get no errors when running fish as an interactive subshell.  Why it sources it's config?  I guess, that's just what it's doing by default unless --no-config is given...

Offline

#16 2026-04-02 21:20:39

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

I can reproduce the issue with this minimal fish config:

❯ cd ~/.config/fish 
❯ for f in *                                                                            
      echo $f && cat $f
  end
config.fish
source ~/.config/fish/config_thinkpad-t440p.fish
config_thinkpad-t440p.fish
# Here's just a comment.

I'll ask the fish people tomorrow.  Time for sleep now.  And thanks for your help, chaps!

Offline

#17 2026-04-02 21:22:55

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

What happens if you add a trailing newline?

Offline

#18 2026-04-03 08:51:03

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

For anyone curious, I've reported this issue in the fish bugtracker: https://github.com/fish-shell/fish-shell/issues/12602

Offline

#19 2026-04-03 12:22:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

Again, the file contains just a comment. It may also be completely empty.

So it's the source command itself?

Offline

#20 2026-04-03 13:42:06

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,405
Website

Re: /usr/bin/man broken for my user

Mod note: not a System Administration issue, moving to Applications and DEs.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#21 2026-04-04 16:34:02

tsdh
Member
From: Germany
Registered: 2014-01-07
Posts: 66

Re: /usr/bin/man broken for my user

Yeah, it was the source command itself.  (hostnamectl hostname) seemed not to work when nroff runs it (dropped privileges or something) so the source command was run without args, i.e., it read from stdin stealing that from nroff/man.

Offline

#22 2026-04-04 19:40:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: /usr/bin/man broken for my user

You probably don't want any of this to be ever executed in non-interactive shells anyway hmm

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB