Commenting on #2:

When building busybox, there is a number of config switches. For your binary to 
support "ps -w" you need this in the config:
- CONFIG_DESKTOP is not set

On my 22.04 systems I've got 2 busybox binaries: /usr/bin/busybox (2.1M)
from busybox-static package and /usr/lib/initramfs-tools/bin/busybox
(311K) from busybox-initramfs package. The former was built using
debian/config/pkg/static from the source package (CONFIG_DESKTOP=y), it
does not support "ps -w". The latter was built with
debian/config/pkg/initramfs from the source package (no CONFIG_DESKTOP,
CONFIG_FEATURE_PS_WIDE=y), it supports "ps -w" and, evidently, it is the
one that gets packaged into initramfs.

If your non-desktop busybox was built without CONFIG_FEATURE_PS_WIDE=y,
there should be no problem described in this bug report. In the case,
terminal width would be assumed 79 [1]

To make it work no matter if "ps -w" is supported or not, there are two
options, both based on [2]

1. "ps </dev/null". In this case, ioctl TIOCGWINSZ would be fruitless and the 
hardcoded "80" value will be used.
2. "COLUMNS=80 ps". wh_helper() [3] looks into env vars first.

The former is more like a dirty trick. The latter should be preferred.
In both cases, 80 gets decremented to 79, the hardcoded value when "ps
-w" is not supported.

So, with "COLUMNS=80 ps":
- if "ps -w" is not supported, the hardcoded terminal width 79 is used
- otherwise, the width gets set to getenv("COLUMNS")-1, which is 79 as well


You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

  cryptroot-unlock doesn't work at all when terminal width is below 51

To manage notifications about this bug go to:

ubuntu-bugs mailing list

Reply via email to