Skip to content

Ticket #5203: fix man viewing with mandoc in user menu - #5203

Merged
zyv merged 1 commit into
MidnightCommander:masterfrom
mxlgv:fixed-manpage-view-mandoc
Oct 24, 2026
Merged

zyv merged 1 commit into
MidnightCommander:masterfrom
mxlgv:fixed-manpage-view-mandoc

Conversation

@mxlgv

@mxlgv mxlgv commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Proposed changes

A common environment variable PAGER has been added for non man-db systems.

  • Fixed: If a man implementation other than man-db (e.g., mandoc) is installed on the system, an error occurs when opening a man page, because mandoc does not support the -P option.

See Debian manpages:

The PAGER option is used instead of MANPAGER for better compatibility with Solaris, AIX and HP-UX systems.

Checklist

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@github-actions github-actions Bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Oct 23, 2026
@github-actions github-actions Bot added this to the Future Releases milestone Oct 23, 2026
@zyv zyv added area: config Configuration INI files and removed needs triage Needs triage by maintainers labels Oct 24, 2026
@zyv zyv modified the milestones: Future Releases, 4.9.0 Oct 24, 2026
Comment thread misc/mc.menu.in Outdated
m View manual page
MAN=%{Enter manual name}
%view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 man -P cat "$MAN"
%view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 MANPAGER=cat man "$MAN"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
%view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 MANPAGER=cat man "$MAN"
%view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 PAGER=cat man "$MAN"

It seems that PAGER is universally supported, including across Solaris, AIX and HP-UX, and MANPAGER is only supported on Linux/BSD. I don't think in this context it's absolutely necessary to use MANPAGER specifically; does PAGER work for you?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will work. The documentation simply stated that MANPAGER should be used as a priority. If PAGER is more versatile, I’ll make the change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, please do it, and I'll merge. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zyv fixed

Many implementations of `man` lack the `-P` option.
For example, `mandoc`, as well as those found on Solaris, AIX, HP-UX,
and certain other systems. Therefore, this option is replaced by the
universal environment variable PAGER.

Signed-off-by: Max Logaev <logaevmax@gmail.com>
@mxlgv
mxlgv force-pushed the fixed-manpage-view-mandoc branch from 3293008 to 934987e Compare October 24, 2026 16:25
@zyv zyv changed the title Fixed manpage viewing for mandoc Ticket #5203: fixed man page viewing for mandoc Oct 24, 2026
@zyv zyv changed the title Ticket #5203: fixed man page viewing for mandoc Ticket #5203: fix man page viewing for mandoc in user menu Oct 24, 2026
@zyv zyv changed the title Ticket #5203: fix man page viewing for mandoc in user menu Ticket #5203: fix man viewing with mandoc in user menu Oct 24, 2026

@zyv zyv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, much appreciated! 🙏

@zyv
zyv merged commit 6cfdb0c into MidnightCommander:master Oct 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Configuration INI files prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

2 participants