I realize this is an old question.(and even older bug)
The first line in @jcharaoui answer should read "doesn't work properly"
Setting the terminal type using TERM=
does not work for me.
For the record, the bulk of my terminal usage these days is using xterm.js.
After much testing, my semi-educated assumption is this: It seems whiptail still reserves button space when using infobox even though no buttons are shown and no additional space is allocated. Then when whiptail tries to display the text, it sees that the space is reserved for the buttons and won't render text in that reserved space. Compare the height of a rendered msgbox vs infobox with the same text. The difference amounts to 2 lines. The same is observed when displaying a long paragraph. The last 2 lines are cut off. When they coded infobox, they reduced the height of the dialog by the 2 lines of button space but left the actual button space and took the space where the text goes.
My workaround is to simply make the infobox taller. If I'm using a heredoc or a multi-line string to create the message, I add 2 newlines to the end. If it's a simple message, I manually use n+6 as the height, where n is the number of lines of text and 6 is the number of reserved lines in a basic whiptail dialog, 2 top and 4 bottom(2 are for the buttons). Yes, 6 reserved lines does seem to clash with a 5 line tall default infobox. So, for 1 line of text, the height would be 7. With that said, setting height to 0 to make it dynamic like the OP example shows causes it to not render the text, which doesn't happen with dialogs that have buttons.
# this works
whiptail --infobox "Message" 7 0
# this doesn't
whiptail --infobox "Message" 0 0
I have filed a bug report with this information. Considering how long this bug has been actively dismissed and ignored, I don't expect the newt team to even look at it. I really hope they do though. This is just one imperfect human's postion on the matter, of course.