Bug 273582 - man: check if run in a pipe before invoking MANPAGER
Summary: man: check if run in a pipe before invoking MANPAGER
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-05 16:42 UTC by Mina Galić
Modified: 2023-09-05 16:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mina Galić freebsd_triage 2023-09-05 16:42:03 UTC
setting MANPAGER to something esoteric like `nvim +Man!` means that programs such as emacs which allow preview of man pages, will hang forever, waiting for nvim to produce output on stdin.

man should check if it's being invoked in a pipe (using tty(1)), and only if it isn't, invoke MANPAGER.