On Sat, Apr 22, 2006, Manoj Srivastava wrote: > > #363250 is more about documenting the semantics of $PAGER (whether > > it can uses sh syntax, or whether it's a command with parameters > > separated with spaces), to be documented in man man, and/or policy. > Err, we should define how it behaves, not what is inside > it. As long as one can pipe things to $PAGER or use $PAGER on a file, > what it contains should not matter.
Please read again the original report, the submitter wanted to have a pipe of commands in $PAGER, he said this worked in the past, and works on other distros. He did not want to simply be able to use $PAGER on a file or to pipe stuff to $PAGER, he wanted $PAGER to be parsed as a pipeline, as in sh syntax. > The safe bet would be for $PAGER to be a script or executable > which can handle reading from file or STDIN, like proper UNIX > programs. This is an independent problem First, we already have one layer of sh scripting with the sensible-pager program, and it would be a good enough place to handle the cases you mention, would people and programs use sensible-pager as the default pager. Second, this doesn't define what should happen when someone redefines $PAGER: what if one user wants $PAGER to be a pipeline? > To make life easier for people writing programs which deal > with $PAGER, and are using the POSIX exce* set of calls, one may > constrain $PAGER to "path [arg [arg ..]]", with no pipes or other > shell meta-characters. Yes, I think this is safe, but I'd go even further and propose the following: A/ handling of pager in programs 1/ programs should default to sensible-pager 2/ programs should offer a way to override the default pager in some way, for example via an environment variable called <program>_PAGER, or a configuration setting -- it might even be better for them to avoid handling $PAGER, see 1/ B/ user configuration of the pager When defined, $PAGER is a sh pipeline which reads its data from stdin. This is with the intent of moving any logic for deciding of the best pager to run out of each individual program requiring a pager, exactly as in the sensible-browser case, which can consider $BROWSER, $DISPLAY, x-www-browser, and www-browser to find a sensible browser. Manoj, how would this fit in policy? -- Loïc Minier <[EMAIL PROTECTED]> "You can gtk_main_run, but you can't gtk_widget_hide." --danw, 19-jul-04 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]