packages: adapter - use less only if terminal is to short
Przemyslaw Iskra
sparky at pld-linux.org
Tue Dec 1 11:15:39 CET 2009
On Tue, Dec 01, 2009 at 10:00:43AM +0200, Elan Ruusamäe wrote:
> On Tuesday 01 December 2009 04:39:48 sparky wrote:
> resize is x11/xorg dep, and can be missing on some systems.
>
> use stty size instead:
> set -- $(stty size)
>
> > + if [ $l -gt $LINES ]; then
> > + diffcol $1 | less -r
> > + else
> > + diffcol $1
> > + fi
> > +}
>
> why you just don't set "less -E" ?
>
> and rather set it privately in $LESS, as i personally do expect the "q" to be
> input, and if sometimes it's not input, the "q" might go to wrong place.
oh, soosh.
I personally consider very annoying not being able to see what I'm
accepting -- there are terminals, like gnome-terminal, which switch
buffers for normal and ncurses-based operation, so after I exit less, or
it exists for me (in case of -E or -F), I'm unnable to see the text
anymore.
Having to press "q" is annoying as well.
And lines to long for the terminal get very messy.
So I added PAGER variable, less -r is the default unless you have it
predefined in your environment.
$ cat ~/.adapterrc
PAGER="cat"
--
____ Sparky{PI] -- Przemyslaw _ ___ _ _ ........... LANG...Pl..Ca..Es..En
/____) ___ ___ _ _ || Iskra | | _ \| | | : WWW........ppcrcd.pld-linux.org
\____\| -_)'___| ||^'||//\\// < | _/| | | : JID......sparky<at>jabberes.org
(____/|| (_-_|_|| ||\\ || |_ |_| |_| _| : Mail....sparky<at>pld-linux.org
More information about the pld-devel-en
mailing list