#945320 whiptail --scrolltext bars start below text/are hidden

Package:
whiptail
Source:
newt
Description:
Displays user-friendly dialog boxes from shell scripts
Submitter:
MichaIng
Date:
2025-06-18 13:53:01 UTC
Severity:
normal
#945320#5
Date:
2019-11-22 23:10:21 UTC
From:
To:
When using whiptail with the "--scrollbar" option, besides the text
scrolling ability, scroll bars should show up on the right side of the
whiptail window.
This is the case, but the bars start below the lines that are used by
the text already, regardless if the text reaches the right side or not.
Scrolling and scroll bars only make sense, when the text lines exceed
the whiptail window lines, hence in all reasonable cases, the scroll
bars are hidden completely.

Scrolling is always possible with this option as expected and as well
the issue does not appear on selection fields of --menu and --checklist,
which have their own scroll bars, when required, which show up fine.
Screenshots can be found here:
https://github.com/MichaIng/DietPi/issues/2947

#945320#10
Date:
2025-06-18 13:49:49 UTC
From:
To:
Seems like the width for writing BIDI newlines is too wide. Adjusting the
call
to write_nstring_int() to take tb's width instead fixes this. It seems int
dw is
then obsolete. I was able to test successfully on a ltr and rtl locale.

@@ -381,7 +381,6 @@
     int size;
     char dir = 'N';
     int newdir = 1;
-    int dw = 0;

     if (!c->isMapped)
     return;
@@ -414,7 +413,7 @@
         SLsmg_write_string(tb->blankline);
         newtGotorc(c->top + i, c->left);
         /* BIDI: we need *nstring* here to properly align lines */
-        write_nstring_int(tb->lines[i + tb->topLine], c->width - dw, &dir);
+        write_nstring_int(tb->lines[i + tb->topLine], tb->textWidth, &dir);
         /* Does new paragraph follow? */
         if (!*tb->lines[i + tb->topLine])
               dir = 'N';