whiptail or dialog

whiptail is installed by default on most deb-based systems, while dialog is not.

Afair, on rpm-based whiptail is also default dialog app.

I guess it matters for you.

So whiptail is the right choice from point of portability.

Also whiptail is based on newt, while dialog is based on ncurses. From my point of view, the first one is more beautiful (:


According to the COMPATIBILITY section of the dialog(1) manual page:

Then there is whiptail. For practical purposes, it is maintained by Debian (very little work is done by its upstream developers). Its documentation (README.whiptail) claims

whiptail(1) is a lightweight replacement for dialog(1), to provide dialog boxes for shell scripts. It is built on the newt windowing library rather than the ncurses library, allowing it to be smaller in embedded environments such as installers, rescue disks, etc.

whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc.

Comparing actual sizes (Debian testing, 2007/1/10): The total of sizes for whiptail, the newt, popt and slang libraries is 757 KB. The comparable number for dialog (counting ncurses) is 520 KB. Disregard the first paragraph.

The second paragraph is misleading, since *whiptail** also does not work for common options of dialog, such as the gauge box. whiptail is less compatible with dialog than the original mid-1990s dialog 0.4 program.

whiptail's manpage borrows features from dialog, e.g., but oddly cites only dialog versions up to 0.4 (1994) as a source. That is, its manpage refers to features which were borrowed from more recent versions of dialog, e.g.,

  • --gauge (from 0.5)

  • --passwordbox (from Debian changes in 1999),

  • --default-item (from dialog 2000/02/22),

  • --output-fd (from dialog 2002/08/14).

Somewhat humorously, one may note that the popt feature (undocumented in its manpage) of using a "--" as an escape was documented in dialog's manpage about a year before it was mentioned in whiptail's manpage. whiptail's manpage incorrectly attributes that to getopt (and is inaccurate anyway).


Why not use both:

(Requires bash 4)

#!/usr/bin/env bash
t(){ type "$1"&>/dev/null;}
function Menu.Show {
   local DIA DIA_ESC; while :; do
      t whiptail && DIA=whiptail && break
      t dialog && DIA=dialog && DIA_ESC=-- && break
      exec date +s"No dialog program found"
   done; declare -A o="$1"; shift
   $DIA --backtitle "${o[backtitle]}" --title "${o[title]}" \
      --menu "${o[question]}" 0 0 0 $DIA_ESC "$@"; }



Menu.Show '([backtitle]="Backtitle"
            [title]="Title"
            [question]="Please choose:")'          \
                                                   \
            "Option A"  "Stuff...."                \
            "Option B"  "Stuff...."                \
            "Option C"  "Stuff...."