automated COL and WCOL settings

Mark Hymers mark-lfs at hymers.org.uk
Wed Jul 18 06:25:16 PDT 2001


On Wed, 18, Jul, 2001 at 02:20:09AM +0000, Thomas Beaudry wrote:
> 
> # If COLUMNS hasn't been set yet, do it ourself
> if [ -z "$COLUMNS" ] 
>	then
> 
> 	# Get the console device if we don't have it already
> 	test -z "$CONSOLE" && CONSOLE=/dev/console
> 
> 	# Get the console size (rows columns)
> 	SIZE=$(stty size < $CONSOLE)
> 
> 	# Strip off the rows leaving the columns
> 	COLUMNS=${SIZE#*\ }
> 	fi
> 
> COL=$[$COLUMNS - 10]
> WCOL=$[$COLUMNS - 30]
>
Nice.  I'm putting this into bugzilla.  Again, if people have comments
then let lfs-discuss know.
It still doesn't work quite as intended in xterms or konsoles... I'm 
going to have a look at this when I get a second unless one of you can 
suggest anything.  If not, I think we should use this anyway.

Mark
-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message



More information about the lfs-dev mailing list