help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] procps output truncated due to bash setting $COLUMNS


From: Steven W. Orr
Subject: Re: [Help-bash] procps output truncated due to bash setting $COLUMNS
Date: Tue, 08 Jan 2013 13:34:46 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 1/8/2013 1:14 PM, Bob Proulx wrote:
Jan Engelhardt wrote:
Pierre Gaston wrote:
Bash sets COLUMNS when interactive, but it does not export it so it
should not interfere with other tools unless it is exported in one of
your startup files.

Hrrrm.

17:57 nakamura:~ > unset LINES COLUMNS
17:57 nakamura:~ > perl -le 'print $ENV{COLUMNS}'

17:57 nakamura:~ > bash --noprofile --norc
bash-4.2$ perl -le 'print $ENV{COLUMNS}'
80

It would seem it exports it by default.

I cannot recreate that result.

   $ echo $COLUMNS
   80
   $ printenv COLUMNS
   ...nothing...

   $ echo $BASH_VERSION
   4.2.37(1)-release

   $ echo $BASH_VERSION
   4.1.5(1)-release

Bob


Look in your init file (*all* of them). Look for things like:

alias rs='set noglob; eval `resize -u`'; unset noglob
or
xsize() {
  set -- $(stty size)
  export LINES=$1
  export COLUMNS=$2
  xtitle
}

or

PROMPT_COMMAND=xsize

Something is doing something.

Also, bash --noprofile --norc, I don't believe is an insulator of environment variables leaking through. A proper test *might* be

env - bash --noprofile --norc

but that doesn't work for me either. I still get them set but they are *not* environment variables. They are just locals. Same result with or without the env -.

502 > env - bash --noprofile --norc
bash-4.2$ env | egrep 'LINES|COLUMNS'
*bash-4.2$ set | egrep 'LINES|COLUMNS'
COLUMNS=80
LINES=24
bash-4.2$ perl -le 'print $ENV{COLUMNS}'

bash-4.2$


I do see this in the man pages:


       COLUMNS
              Used by the select compound command to  determine  the  terminal
              width  when  printing  selection  lists.  Automatically set upon
              receipt of a SIGWINCH.

       LINES  Used by the select compound  command  to  determine  the  column
              length  for  printing  selection  lists.  Automatically set upon
              receipt of a SIGWINCH.

--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]