From owner-cvs-src-old@FreeBSD.ORG Fri Jun 3 14:34:57 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D5171065703 for ; Fri, 3 Jun 2011 14:34:57 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7B87A8FC0C for ; Fri, 3 Jun 2011 14:34:57 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p53EYvlv037618 for ; Fri, 3 Jun 2011 14:34:57 GMT (envelope-from ru@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p53EYvd5037617 for cvs-src-old@freebsd.org; Fri, 3 Jun 2011 14:34:57 GMT (envelope-from ru@repoman.freebsd.org) Message-Id: <201106031434.p53EYvd5037617@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ru@repoman.freebsd.org using -f From: Ruslan Ermilov Date: Fri, 3 Jun 2011 14:34:38 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/man man.1 man.sh X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 14:34:57 -0000 ru 2011-06-03 14:34:38 UTC FreeBSD src repository Modified files: usr.bin/man man.1 man.sh Log: SVN rev 222653 on 2011-06-03 14:34:38Z by ru When MANCOLOR environment variable is set, enable ANSI color escapes in grotty(1). This makes it possible to view colorized manpages in color. When MANPAGER environment variable is set, use it instead of PAGER. Why another environment variable, one might ask? With color output enabled, both a terminal and a pager should support the ANSI color escapes. On a supporting terminal, less(1) with option -R would be such a pager, while "more -s" (the current default pager for man(1)) will show garbage. It means a different default pager is needed when color output is enabled, but many people have PAGER set customary, and it's unlikely to support ANSI color escapes, so introducing yet another variable (MANPAGER) seemed like a good option to me: - if MANPAGER is set, use that unconditionally; - if you disable color support (it is by default), and don't set MANPAGER, you get an old behavior: -P pager, $PAGER, "more -s", in that order; - if you enable color support (by setting MANCOLOR), and don't set MANPAGER, we ignore PAGER which is unlikely to support ANSI color escapes, and you get: -P pager, "less -Rs", in that order; - you might have good reasons for different man(1) and general purpose pagers; - later versions of GNU man(1) support MANPAGER. Revision Changes Path 1.7 +17 -3 src/usr.bin/man/man.1 1.14 +22 -10 src/usr.bin/man/man.sh