Page MenuHomeFreeBSD

D61747.1795408477.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61747.1795408477.diff

diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1
--- a/usr.bin/man/man.1
+++ b/usr.bin/man/man.1
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 24, 2025
+.Dd November 19, 2026
.Dt MAN 1
.Os
.Sh NAME
@@ -370,6 +370,16 @@
If that has no value either,
.Ql less -s
is used.
+.Pp
+If standard output is not a terminal,
+no pager is used and the output is written directly to standard output,
+regardless of the value of
+.Ev MANPAGER
+or
+.Ev PAGER ,
+unless a pager was given with the
+.Fl P
+option.
.El
.Sh FILES
.Bl -tag -width "/usr/local/etc/man.d/*.conf" -compact
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -616,7 +616,8 @@
K) Kflag=Kflag
REGEXP=$OPTARG ;;
M) MANPATH=$OPTARG ;;
- P) MANPAGER=$OPTARG ;;
+ P) MANPAGER=$OPTARG
+ Pflag=Pflag ;;
S) MANSECT=$OPTARG ;;
a) aflag=aflag ;;
d) debug=$(( $debug + 1 )) ;;
@@ -963,7 +964,9 @@
# Correctly sets $MANPAGER
setup_pager() {
# Setup pager.
- if [ -z "$MANPAGER" ]; then
+ if [ -z "$Pflag" ] && [ ! -t 1 ]; then
+ MANPAGER=cat
+ elif [ -z "$MANPAGER" ]; then
if [ -n "$MANCOLOR" ]; then
MANPAGER="less -sR"
else

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 23, 4:34 AM (10 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41867325
Default Alt Text
D61747.1795408477.diff (1 KB)

Event Timeline