[GRASS5] which, less and SUBMITTING
Glynn Clements
glynn.clements at virgin.net
Wed Apr 11 16:04:20 EDT 2001
Reinhard Brunzema wrote:
> Linux users expect man running the 'less-way'.
So what? The world does not revolve around Linux users, or their
expectations.
Having said that, I do agree that programs shouldn't try to override
system defaults. System environment variables (PAGER etc) should be
left alone; i.e. if PAGER is unset, it should be left unset (which
should cause "man" to use whatever pager is specified in
"man.config").
If it's too much effort to make GRASS' code handle the case where no
pager is specified (e.g. if lots of files use something like
popen("$PAGER")), the simplest fix is to use a different environment
variable (e.g. GRASS_PAGER) within GRASS. The startup could then
ensure that this is set to something whilst leaving PAGER alone.
> When they want the old and common behavior of the man pages back, they
> have to do a lot of work. I don't mean adding PAGER=less in a
> configuration file - I mean finding out, what they have to do. You have
> to be a unix/linux expert or at least a advanced user to know that PAGER
> is related to man.
Well, you have to be capable of reading the man(1) manpage. It's a
pretty sad state of affairs when that is considered the preserve of
"advanced" users.
> In general I think, a program should keep as much work away from the
> user as possible.
That doesn't mean it should do things that aren't its responsibility;
that way lies needless complexity, which only makes the program harder
to understand and its behaviour less predictable.
> > This would allow individual customization of the pager, which is in my
> > eyes the purpose of the GRASS initialization setup. The code in init.sh
> > is IMHO only providing a fallback in case no PAGER variable is set.
>
> The new code wouldn't change that behavior. It's just a better fallback.
"Better" is subjective. "more" may be primitive, but it seldom fails
horribly, as "less" often does if curses is broken, or if termcap or
terminfo are broken[1], or if $TERM is incorrectly set[2].
Also, "less" moans about dumb terminals (ones which don't support
cursor positioning), and dumps loads of cruft into the output, which
is a nuisance if you're capturing it (e.g. with "script") for later
reference.
[1] Quite common; many people modify them to match bugs in a specific
terminal emulator. Of course, as a result, anyone with a working
terminal of the corresponding type (or emulation thereof) is totally
stuffed.
[2] also quite common; e.g. it's often set to "vt100" by programs
which don't even come close.
--
Glynn Clements <glynn.clements at virgin.net>
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'
More information about the grass-dev
mailing list