grumble about GNU info

Eric Battersby gyre-Ja3L+HSX0kI at public.gmane.org
Tue Dec 16 09:07:37 UTC 2008


On Mon, 15 Dec 2008, D. Hugh Redelmeier wrote:

> | From: Kyle O'Donnell <kyleodonnell-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
>
> | unalias ls ?
>
> Sure.  Or type /bin/ls.

Or '\ls'.

> | From: Chris F.A. Johnson <cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org>
>
> | > As is too often the case, the ls(1) manpage is incomplete.  It does not
> | > describe the environment variable LS_COLORS (it should).  ls(1) says
> | > the full documentation is in texinfo.
> |
> |     My ls man page does mention LS_COLORS and refers the reader to the
> |     dircolors command.
>
> Right.  I wasn't clear.  ls(1) does mention LS_COLORS but does not
> describe it.  Neither does dircolors(1).

I see it described in my old dircolors(1) man page from 1997.
Today, they moved the docs into dir_colors(5).

> |     However, that is probably not the problem, and the problem will
> |     not be obvious from any man page. Some distros have the stupid
> |     practice of setting aliases for some standard commands;
> |     "ls ==color=auto" is one of the commonn ones. To prevent this I
> |     always put "unalias -a" at the top of my .bashrc file.
>
> I try to keep my customization to a minimum.  I find that it is like a
> ball and chain that I have to drag around from system to system.
> But I always do some.

Isn't some customization a good thing, so you can do real work
faster?  Today customization is easier than ever.
In the past, you'd have to carry around your floppy.
Today, you'd have a USB stick or you'd download it from a web
page and 'source' it.


> The alias on Fedora 9 and Ubuntu 8.10 seems to be "ls --color=tty".
> Another undocumented setting.  Grunt.

I was not aware that 'tty' had been discontinued (or deprecated).
The sub-options of '--color' were 'yes,no,tty'.
Now they are 'never,always,auto'.
I question these pointless changes.

> On Fedora 9, the colorization does not happen in the case that annoys
> me but it does on Ubuntu 8.10.  The case is inside my text editor: it
> provides a fake terminal, inside a window, for running shell commands.
>
> The $TERM setting is "vanilla" on Fedora and "dumb" on Ubuntu (at one
> time these were reasonable).

BTW, on Fedora 7, in the Jove text editor, when running
a fake terminal (shell), TERM is set to 'dumb' for me.

   $ echo $TERM
   dumb

Also, note that 'dircolors' should not generate an $LS_COLORS
string for 'dumb' or 'vanilla' when I tested it:

   $ TERM=dumb dircolors
   LS_COLORS='';
   export LS_COLORS
   $ TERM=vanilla dircolors
   LS_COLORS='';
   export LS_COLORS

What do you get?
Does your system have a 'dir_colors' entry for those terminal types?
Try: grep TERM   /etc/DIR_COLORS*  ~/.dir*col*


> On Fedora:
>    $ echo $TERM
>    vanilla
>    $ typeset -p TERM
>    declare -x TERM="vanilla"
>    $ infocmp -L
>    infocmp: couldn't open terminfo file /lib/terminfo/v/vanilla.
>    $ TERM=dumb infocmp -L
>    # Reconstructed via infocmp from file: /usr/share/terminfo/d/dumb
>    dumb|80-column dumb tty,
> 	    auto_right_margin,
> 	    columns#80,
> 	    bell=^G, carriage_return=^M, cursor_down=^J,
> 	    scroll_forward=^J,
>    $
>
>
> On Ubuntu, I get a result that surprises me.
>
>    $ echo $TERM
>    dumb
>    $ typeset -p TERM
>    declare -- TERM="dumb"
>    $ infocmp -L
>    infocmp: environment variable TERM not set
>    $ TERM=dumb infocmp -L
>    #       Reconstructed via infocmp from file: /lib/terminfo/d/dumb
>    dumb|80-column dumb tty,
> 	    auto_right_margin,
> 	    columns#80,
> 	    bell=^G, carriage_return=^M, cursor_down=^J,
> 	    scroll_forward=^J,
>    $
>
> How did TERM get set to be unexported?  From looking at an strace, it
> seems that JOVE has been compiled to not export TERM to the shell.  (I
> built JOVE for Fedora (for myself) but someone else builds it for Ubuntu.)
>
> In any case, exporting TERM=dumb does not fix ls on Ubuntu.  Nor does
> making TERM "vanilla".

By fix 'ls', I assume you mean not define the alias.
The alias is not defined (in /etc/profile.d/colorls.sh)
if $LS_COLORS is empty after eval'ing 'dircolors'.
To fix, comment out the 'dumb' or 'vanilla' TERM entry
in the appropriate file: /etc/DIR_COLORS*  ~/.dir*col* .
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list