Bug 1117 - COLUMNS are not detected
: COLUMNS are not detected
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/initscripts)
: unstable
: all Linux
: P4 minor
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2002-07-17 16:14 by
Modified: 2003-08-25 15:55 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2002-07-17 16:14:01
Now, COLUMNS do not correspond to the real terminal width, but are always set
to 80 in /etc/init.d/functions.

This is due to the new, more correct way bash decides whether it is interactive
and the fact that COLUMNS are set and maintained by bash only in interactive
mode.

If the terminal is more narrow than 80 (resized xterm, for example), the output
of /sbin/service is not nice.


---
When my system boots, the console on framebuffer is wide, but the OKs appear at
80, not at the right edge as it used to be before.

Run /sbin/service named restart in a naroow (or wide) xterm -- the OKs will
also appear not at the edge, but either on the next line or at the 80th column.
---
initscripts-5.49-ipl44mdk
------- Comment #1 From 2002-07-17 22:27:20 -------
Any ideas how to fix that properly?
------- Comment #2 From 2002-07-17 22:27:20 -------
Any ideas how to fix that properly?
------- Comment #3 From 2002-07-18 13:22:37 -------
I can think of two ways:

1. invoke shell like \'/bin/sh -i\' to make it look after COLUMNS (since it doesn\'t require libtinfo, I guess, it uses some ioctl to determine the width);

2. use termutils (see #1076; I call so the simple wrappers around libtinfo) like it is done in /user/imz/RPM/SOURCES/distribute-0.3.91/usr/lib/distribute/functions
But then an extra-dependency on tibtinfo is added for initscripts, I don\'t think this is the proper way.
------- Comment #4 From 2002-07-18 13:22:37 -------
I can think of two ways:

1. invoke shell like \'/bin/sh -i\' to make it look after COLUMNS (since it doesn\'t require libtinfo, I guess, it uses some ioctl to determine the width);

2. use termutils (see #1076; I call so the simple wrappers around libtinfo) like it is done in /user/imz/RPM/SOURCES/distribute-0.3.91/usr/lib/distribute/functions
But then an extra-dependency on tibtinfo is added for initscripts, I don\'t think this is the proper way.
------- Comment #5 From 2002-09-28 19:37:41 -------
To use termutils, I\'ll have to move tput from /usr/bin/ to /bin/; yes, tput is
more portable...
------- Comment #6 From 2002-09-28 19:37:41 -------
To use termutils, I\'ll have to move tput from /usr/bin/ to /bin/; yes, tput is
more portable...
------- Comment #7 From 2002-12-08 19:45:30 -------
BTW, /bin/ls is already linked with -ltinfo, so I see no problem adding
dependence on termutils to initscripts.

Well, I\'ve relocated tput to /bin/.
------- Comment #8 From 2002-12-08 19:45:30 -------
BTW, /bin/ls is already linked with -ltinfo, so I see no problem adding
dependence on termutils to initscripts.

Well, I\'ve relocated tput to /bin/.
------- Comment #9 From 2002-12-08 21:01:18 -------
Implemented in initscripts-5.49-ipl46mdk,
based on distribute-0.4.0/usr/lib/distribute/functions
------- Comment #10 From 2002-12-08 21:01:18 -------
Implemented in initscripts-5.49-ipl46mdk,
based on distribute-0.4.0/usr/lib/distribute/functions
------- Comment #11 From 2002-12-15 01:32:00 -------
This fix appeared to be incomplete:
it doesn\'t work with cases like this:
action \"test\" true 2>/dev/null
------- Comment #12 From 2002-12-15 01:32:00 -------
This fix appeared to be incomplete:
it doesn\'t work with cases like this:
action \"test\" true 2>/dev/null
------- Comment #13 From 2002-12-15 01:33:14 -------
Fixed in
initscripts-5.49-ipl47mdk + sh-2.05b-alt4
------- Comment #14 From 2002-12-15 01:33:14 -------
Fixed in
initscripts-5.49-ipl47mdk + sh-2.05b-alt4