Bug 1117 - COLUMNS are not detected
Summary: COLUMNS are not detected
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: initscripts (show other bugs)
Version: unstable
Hardware: all Linux
: P4 minor
Assignee: Dmitry V. Levin
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-17 16:14 MSD by imz
Modified: 2003-08-25 15:55 MSD (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description imz 2002-07-17 16:14:01 MSD
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 Dmitry V. Levin 2002-07-17 22:27:20 MSD
Any ideas how to fix that properly?
Comment 2 Dmitry V. Levin 2002-07-17 22:27:20 MSD
Any ideas how to fix that properly?
Comment 3 imz 2002-07-18 13:22:37 MSD
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 imz 2002-07-18 13:22:37 MSD
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 Dmitry V. Levin 2002-09-28 19:37:41 MSD
To use termutils, I\'ll have to move tput from /usr/bin/ to /bin/; yes, tput is more portable...
Comment 6 Dmitry V. Levin 2002-09-28 19:37:41 MSD
To use termutils, I\'ll have to move tput from /usr/bin/ to /bin/; yes, tput is more portable...
Comment 7 Dmitry V. Levin 2002-12-08 19:45:30 MSK
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 Dmitry V. Levin 2002-12-08 19:45:30 MSK
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 Dmitry V. Levin 2002-12-08 21:01:18 MSK
Implemented in initscripts-5.49-ipl46mdk,
based on distribute-0.4.0/usr/lib/distribute/functions
Comment 10 Dmitry V. Levin 2002-12-08 21:01:18 MSK
Implemented in initscripts-5.49-ipl46mdk,
based on distribute-0.4.0/usr/lib/distribute/functions
Comment 11 Dmitry V. Levin 2002-12-15 01:32:00 MSK
This fix appeared to be incomplete:
it doesn\'t work with cases like this:
action \"test\" true 2>/dev/null
Comment 12 Dmitry V. Levin 2002-12-15 01:32:00 MSK
This fix appeared to be incomplete:
it doesn\'t work with cases like this:
action \"test\" true 2>/dev/null
Comment 13 Dmitry V. Levin 2002-12-15 01:33:14 MSK
Fixed in
initscripts-5.49-ipl47mdk + sh-2.05b-alt4
Comment 14 Dmitry V. Levin 2002-12-15 01:33:14 MSK
Fixed in
initscripts-5.49-ipl47mdk + sh-2.05b-alt4