package: whiptail
version: 0.52.23
Severity: normal

Using `whiptail --infobox` on Debian 12, whiptail does not display the last
2 lines of text when using --infobox. I prefer to set height dynamically by
passing 0 for height. When I do that with --infobox and provide 2 or fewer
lines of text, I get a box with no text, 3 lines produces a box with 1 line
of text, etc.

I suspect it is because whiptail reserves the last 2 lines in the dialog
space for buttons. However, --infobox has no buttons and whiptail tries to
use those 2 lines for displaying prompt text instead. Unfortunately,
whiptail still reserves the space for buttons, which --infobox does not
have. The result is whiptail --infobox fails to display the last 2 lines of
text in the window.

I believe whiptail either needs to reserve the button space and not extend
the text space OR extend the text space and not reserve the button space
when using --infobox. Right now it seems to do both.

I ran the following script to determine the line count:

```
#!/usr/bin/env bash
info() {
        cat <<EOF
1
2
3
4
5
6
EOF
}

whiptail --infobox "$(info)" 0 0
sleep 5
```

This displays 1-4 but not 5 and 6.

I use here-doc to create most of my dialogs, but I get the same results
when using any source that causes multiple lines to be displayed, such as
displaying a license to a user.

While I am currently using an lxc as a test system, I have the same results
in VMs and bare-metal as well. Of course all using the latest current
version of bookworm and whiptail.

Operating System: Debian GNU/Linux 12 (bookworm)
Kernel: Linux 6.8.12-2-pve
Architecture: x86-64

Shared C Library
Version: 2.36-9+deb12u8

$ whiptail --version
whiptail (newt): 0.52.23

$ apt-cache depends whiptail
whiptail
  Depends: libc6
  Depends: libnewt0.52
  Depends: libpopt0
  Depends: libslang2

Reply via email to