[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls and pager



On Sun, Sep 16, 2001, Tzafrir Cohen wrote about "RE: ls and pager":
> When I run 'less' I am guaranteed that it won't screw-up my console. If
> you allow it to interepert control chars, then the next time you 'less'
> some garbage file, you may end up screwing up your terminal.

Not quite: less -r is different from less -R: the former shows any control
character (which may have the problem you describe if you less, say, an
executable file), in is indeed not recommended. The latter, which I
recommended, only recognizes ANSI escape sequences for changing color (or
bold, reverse video, etc.): ESC [ ... m. It is highly unlikely that a random
file will contain such a sequence. The worse that could happen after such a
case is that you'll end up in a strange color or bold text or something, and
you can easily fix that by running
	echo -e '\033[0m'
or more simply,
	tput init

[zsh does that automatically for you whenever a command exists, by the
way]

Shana Tova to everybody!

-- 
Nadav Har'El                        |        Monday, Sep 17 2001, 29 Elul 5761
nyh@math.technion.ac.il             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |And now for some feedback:
http://nadav.harel.org.il           |EEEEEEEEEEEEEEEEEEEEEEEEEEE

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il