Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2011 14:34:38 +0000 (UTC)
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/usr.bin/man man.1 man.sh
Message-ID:  <201106031434.p53EYvd5037617@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106031434.p53EYvd5037617>