BSDDIALOG(1)
πΈ NAME πΈ
bsddialog β TUI dialogs
This is the bsddialog(1) page from the General Commands Manual, bestie. Short, iconic, to the point π
β¨ SYNOPSIS β¨
bsddialog --help | --version
bsddialog [--option] --dialog text rows cols [dialog-argument]
[--option]
bsddialog ... --dialog1 ... [--and-dialog --dialog2 ...] ...
π DESCRIPTION π
Okay so bsddialog builds Text User Interface dialogs and widgets β main character energy for your terminal, fr fr.
The option --help prints a brief list of features and exits. The option --version prints the version and exits. The option --and-dialog builds another dialog unless the previous one returns Error, ESC or Cancel.
Each dialog accepts text to print a message inside, rows and cols to set height and width, 0 for autosize and -1 for fullscreen.
The possible input from the user interface is printed to standard error at exit.
π Options π
The following options can change the default behavior of the utility and are common to some dialog. Customization era, let's go β¨
--alternate-screenβ set alternate screen mode if the terminal andcurses(3)provide it. If enabled,bsddialogdraws to the alternate screen and restores the main screen after exit. See βsmcupβ interminfo(5). terminal magic, iconic β¨--ascii-linesβ ASCII characters to draw lines. simple but cute π--backtitlebacktitle β screen title.--begin-xx β set dialog horizontal position,-1center,0left screen.--begin-yy β set dialog vertical position,-1center,0top screen.--bikeshedβ random settings. Colors, title delimiter, button delimiter; see theme features. Title margin. Buttons always active or TAB to switch focus with other components, see--switch-buttons. Zero padding with time output; see--time-format. Zero padding with date output; see--date-format. User Interface date format for--datebox; see--datebox-format.--cancel-exit-coderetval β set an exit code value for the βCancelβ button.--cancel-labellabel β label for the βCancelβ button.--clear-dialogβ hide the dialog at exit.--clear-screenβ clear the screen, wait a dialog if built.--columns-per-rowcolumns β try to set the number of columns for a row of text with autosizing; default10.--cr-wrapβ keep new line in text also if it contains a\n, see--text-unchanged.--datebox-formatformat β string to customize--dateboxinterface, possible values: βd/m/yβ, βm/y/dβ, βy/m/dβ.--date-formatformat β string accepted bystrftime(3)to customize the output of--dateboxand--calendar.--default-buttonlabel β focus on the button with label on startup.--default-itemname β focus on the item with name, for Checklist, Menu, Radiolist and Treeview.--default-noβ focus on βCancelβ or βNoβ button on startup.--disable-escβ disable ESC key to quit.--error-exit-coderetval β set an exit code value for thebsddialogerrors.--esc-exit-coderetval β set an exit code value for the ESC key.--extra-buttonβ add a button with βExtraβ label.--extra-exit-coderetval β set an exit code value for the βExtraβ button.--extra-labellabel β set label for the βExtraβ button.--left1-buttonlabel β add a button with label.--left1-exit-coderetval β set an exit code for--left1-button.--left2-buttonlabel β add a button with label.--left2-exit-coderetval β set an exit code for--left2-button.--left3-buttonlabel β add a button with label.--left3-exit-coderetval β set an exit code for--left3-button.--help-buttonβ add a button with βHelpβ label.--help-exit-coderetval β set an exit code value for the βHelpβ button.--help-labellabel β set label for βHelpβ button.--help-print-itemsβ print also the selected items or form values if the βHelpβ button is pressed.--help-print-nameβ print the name of the focused item if the βHelpβ button is pressed also with--item-bottom-desc.--hfilefilename β open filename in a Textbox if F1 key is pressed.--hlinestring β dialog subtitle.--hmsgstring β open a Msgbox with string if the F1 key is pressed.--ignoreβ do not exit with unknown options.--insecureβ print*to hide passwords while typing, white space otherwise.--item-bottom-descβ set a help string for each item of a Checklist, Form, Menu, Mixedform, Passwordform, Radiolist and Treeview to display at the bottom screen side.--item-depthβ specify a margin for items, available for Checklist, Menu and Radiolist.--item-prefixβ set a string to prefix each item of a Checklist, Menu, Radiolist or Treeview.--load-themefile β load theme from file.--max-inputsize β maximum length of the input for--inputboxand--passwordbox, default2048.--no-cancelβ do not show βCancelβ button.--no-descriptionsβ do not display item descriptions for Checklist, Menu, Radiolist or Treeview; mutually exclusive with--no-names.--no-linesβ do not draw borders and lines.--no-namesβ do not display item names for Checklist, Menu and Radiolist; mutually exclusive with--no-descriptions.--no-okβ do not draw βOKβ button.--no-shadowβ do not draw the shadow of the dialog.--ok-labellabel β set label for βOKβ button.--ok-exit-coderetval β set an exit code value for the βOkβ button.--normal-screenβ set normal screen mode.bsddialogdoes not restore the previous screen after exit. See βrmcupβ interminfo(5).--output-fdfd β print input from user interface to the specified file descriptor.--output-separatorsep β set a separator for the items in output, default white space.--print-maxsizeβ screen size. This option can be used without a dialog.--print-sizeβ print dialog height and width at exit.--print-versionβ print version. This option can be used without a dialog.--quotedβ quote items in output, default only when necessary.--right1-buttonlabel β add a button with label.--right1-exit-coderetval β set an exit code for--right1-button.--right2-buttonlabel β add a button with label.--right2-exit-coderetval β set an exit code for--right2-button.--right3-buttonlabel β add a button with label.--right3-exit-coderetval β set an exit code for--right3-button.--save-themefile β save the current theme. This option can be used without a dialog.--separate-outputβ print selected items separated by a new line and avoid quoting.--shadowβ show a shadow for the dialog, enabled by default.--single-quotedβ use single quote for items in output.--sleepsecs β wait secs seconds to close the dialog.--stderrβ print input from user interface to standard error, default.--stdoutβ print input from user interface to standard output.--switch-buttonsβ enable focus switching between buttons and input components pressing TAB, otherwise buttons are always active and ENTER key closes the dialog. Suitable for:--form,--inputbox,--mixedform,--passwordbox,--passwordform,--timebox,--calendarand--datebox.--tab-escapeβ replace\twith a tab in text.--tab-lenspaces β number of spaces to print a TAB in text.--text-escapeβ enable escapes in text, and here's the whole palette bestie:\Z0β black.\Z1β red.\Z2β green.\Z3β yellow.\Z4β blue.\Z5β magenta.\Z6β cyan.\Z7β white.\Zbβ bold.\ZBβ disable bold.\Zdβ half bright.\ZDβ disable half bright.\Zkβ blink.\ZKβ disable blinking.\Zrβ reverse foreground and background.\ZRβ disable reverse.\Zsβ highlight.\ZSβ disable highlighting.\Zuβ underline.\ZUβ disable underline.\Znβ disable each customization.
--text-unchangedβ disable text modification. By default text is changed before it's printed in the dialog. If it contains at least a\n, each new line and TAB is converted to a space, and subsequent spaces are merged. Otherwise new line characters are preserved and a TAB becomes a space.--themetheme β set theme, possible values: β3dβ, βblackwhiteβ, βflatβ.--time-formatformat β string accepted bystrftime(3)to customize the output of--timebox.--timeout-exit-coderetval β set an exit code value for the--pausetimeout.--titletitle β dialog title.
π Keys π
The following keys are available at runtime:
- Ctrl+l β redraw the dialog.
- F1 β see
--hfileand--hmsg. - SPACE β select menu item.
- UP, DOWN, LEFT, RIGHT, -, +, HOME, END, PAGEUP, PAGEDOWN, Ctrl+p, Ctrl+n, TAB β navigate elements and set value, depending on the dialog.
πͺ Dialogs πͺ
The following dialogs are available:
--calendartext rows cols [day month year] β dialog to select a date.--checklisttext rows cols menurows [name desc status] ... β checklist to select some item from a list via the SPACE key. An item has a name, desc and a default status specified by βonβ or βoffβ. The names of the selected items are printed to standard error. menurows is the graphical height of the list,0for autosize.--dateboxtext rows cols [day month year] β dialog to select a date.--form text rows cols formrows [label ylabel xlabel init yfield xfield fieldlen maxletters] ...β bestie, this is your forms era πΈ. It gets a list of strings via forms. Each form has alabelat positionylabelandxlabel, plus a field for input atyfieldandxfield.fieldlenis the field width: if itβs negative itβs readonly and the width is the absolute value; if itβs0the field becomes readonly and its value is theinitwidth. The field input is not printed to output if itβs readonly.maxlettersis the maximum input length, and if itβs0its value isfieldlen.initis the default value in the field.formrowsis the graphical height of the list,0for autosize. Slay.--gauge text rows cols [percentage]β a dialog with a bar that showspercentage, then it waits to readXXXfrom standard input, then the first string replacespercentageand the following strings replacetextuntil the nextXXX; the loop ends readingEOF. Gauge girlie is lowkey iconic π .--infobox text rows colsβ a dialog without buttons to display a message and exit immediately. Poof, gone β¨.--inputbox text rows cols [init]β a dialog to get a string in input;initis the default value.--menu text rows cols menurows [name desc] ...β builds a menu to select an item from a list. SPACE is equivalent to ENTER. An item has anameand adesc. Thenameof the selected item is printed to standard error.menurowsis the graphical height of the list,0for autosize.--mixedform text rows cols formrows [label ylabel xlabel init yfield xfield fieldlen maxletters flag] ...β dialog to get a list of strings via forms. A form has alabelat positionylabelandxlabel, and a field to get the input at positionyfieldandxfield.fieldlenis the field width: if itβs negative itβs readonly and the width is the absolute value; if itβs0the field becomes readonly and its value is theinitwidth. The field input is not printed to output iffieldlenis less than or equal to0.maxlettersis the maximum input length, and if itβs0its value isfieldlen.initis the default value in the field.flagcan customize the field:0normal,1hide typed characters,2readonly.formrowsis the graphical height of the list,0for autosize.--mixedgauge text rows cols mainperc [minilabel miniperc] ...β dialog to show a main bar representingmainpercfrom0to100. It also has some mini bar with aminilabelstring and aminipercwith a value from0and100or negative to print a descriptive string:-1βSucceededβ,-2βFailedβ,-3βPassedβ,-4βCompletedβ,-5βCheckedβ,-6βDoneβ,-7βSkippedβ,-8βIn Progressβ,-9to hideminiperc,-10βN/Aβ,-11βPendingβ, otherwise βUNKNOWNβ. No cap, the negative numbers are doing a whole language π.--msgbox text rows colsβ dialog to display a message without the βCancelβ button.--passwordbox text rows cols [init]β dialog to get a password;initis the default value. Secretive bestie vibes π.--passwordform text rows cols formrows [label ylabel xlabel init yfield xfield fieldlen maxletters] ...β dialog to get a list of passwords, equivalent to--formexcept typed characters are hidden.--pause text rows cols secondsβ dialog runs untilsecondstimeout expires or a button is pressed. Tick tock β³.--radiolist text rows cols menurows [name desc status] ...β radiolist to select at most an item from a list via the SPACE key. An item has aname,descand a defaultstatusspecified by"on"or"off". Thenameof the selected item is printed to standard error.menurowsis the graphical height of the list,0for autosize.--rangebox text rows cols min max [init]β dialog to select a value betweenminandmax;initis the default value.--textbox file rows colsβ opens and printsfile. TAB changes button. Extra keys0,h,l,k,jare available to navigate the text. The βOKβ button is renamed βEXITβ. Very βIβm just gonna scrollβ energy π.--timebox text rows cols [hour min sec]β dialog to select a time.--treeview text rows cols menurows [depth name desc status] ...β equivalent to Radiolist with--item-depthand--no-name.--yesno text rows colsβ βYes-No Questionβ, and the βOKβ and βCancelβ buttons are renamed βYesβ and βNoβ.
πΏ ENVIRONMENT
The following environment variables take effect only on startup; other options can override their setting.
NO_COLORβ if present and not an empty string (regardless of its value), itβs equivalent to--theme blackwhite.BSDDIALOG_ERROR,BSDDIALOG_OK,BSDDIALOG_CANCEL,BSDDIALOG_HELP,BSDDIALOG_EXTRA,BSDDIALOG_TIMEOUT,BSDDIALOG_ESC,BSDDIALOG_LEFT1,BSDDIALOG_LEFT2,BSDDIALOG_LEFT3,BSDDIALOG_RIGHT1,BSDDIALOG_RIGHT2,BSDDIALOG_RIGHT3β set exit codes.BSDDIALOG_THEMEFILEfile β equivalent to--load-themefile.
π FILES
The theme file $HOME/.bsddialog.conf is read on startup if it exists. Bestie, thatβs your lilβ config moment π.
π¦ EXIT STATUS
The bsddialog utility exits 255 on unsuccessful, otherwise depending on the button or key pressed the following values can be returned:
0β βOKβ, βYesβ or βExitβ button.1β βCancelβ or βNoβ button.2β βHelpβ button.3β βExtraβ button.4β Timeout.5β ESC key.6β Left1 generic button.7β Left2 generic button.8β Left3 generic button.9β Right1 generic button.10β Right2 generic button.11β Right3 generic button.
π EXAMPLES
Backtitle, title and message:
bsddialog --backtitle MESSAGE --title Msgbox --msgbox Message 0 0
Yes-No Question and theme:
bsddialog --theme blackwhite --yesno Question 10 30
Save a custom theme:
bsddialog --save-theme mytheme.txt --infobox "Saving theme..." 0 0
Load a custom theme:
bsddialog --load-theme mytheme.txt --infobox "Custom theme" 0 0
Checklist:
bsddialog --checklist Checklist 0 0 3 N1 D1 off N2 D2 on N3 D3 off
Form:
bsddialog --form Form 0 0 0 L1: 0 0 X 0 4 20 25 L2: 1 0 Y 1 4 20 25
Multi-dialog:
bsddialog --normal-screen --begin-y 1 --yesno Continue? 0 0 \
--and-dialog --begin-y 10 --infobox Yes 0 0
Bikeshed:
bsddialog --bikeshed --inputbox Example 0 0
bsddialog --bikeshed --datebox Example 0 0
Mixedgauge:
bsddialog --sleep 3 --mixedgauge Example 10 30 60 L1 " -1" L2 30
Mixedgauge script:
perc=0
while [ $perc -le 100 ]
do
bsddialog --sleep 1 --title Mixedgauge \
--mixedgauge "\nExample...\n" 0 0 $perc \
"Hidden" " -9" \
"Label 1" " -4" \
"Label 2" " -4" \
"Label 3" $perc
perc=`expr $perc + 20`
done
Gauge script:
i=1
for c in A B C D E F G H
do
sleep 1
echo XXX
echo "$(expr $(expr $i "*" 100) "/" 8)"
echo "[$i/8] Char: $c"
echo XXX
if [ $i -eq 8 ]
then
sleep 1
echo EOF
fi
i=`expr $i + 1`
done | bsddialog --title Gauge --gauge "Starting..." 10 70
π COMPATIBILITY
Outdated options are retained for compatibility; properly equivalent options are used:
--and-widgetβ--and-dialog--calendar <text> 2 <cols>β--calendar <text> 0 <cols>--clearβ--clear-screen--colorsβ--text-escape--defaultnoβ--default-no--exit-labelβ--ok-label--help-statusβ--help-print-items--help-tagsβ--help-print-name--item-helpβ--item-bottom-desc--keep-titeβ--alternate-screen--no-itemsβ--no-descriptions--no-labelβ--cancel-label--no-tagsβ--no-names--nocancelβ--no-cancel--nookβ--no-ok--separatorβ--output-separator--yes-labelβ--ok-label
π SEE ALSO
Check out bsddialog(3), strftime(3), and terminfo(5).
π HISTORY
The bsddialog utility first appeared in FreeBSD 14.0.
π AUTHORS
bsddialog was written by Alfonso Sabato Siciliano β¨asiciliano@FreeBSD.orgβ©.
bsddialog provides also a subset of the functionality described in the dialog manual. The following features were reimplemented:
Options: --and-widget, --ascii-lines, --backtitle, --cancel-label, --clear, --colors, --cr-wrap, --date-format, --defaultno, --default-button, --default-no, --default-item, --exit-label, --extra-button, --extra-label, --help, --help-button, --help-label, --help-status, --help-tags, --hfile, --hline, --ignore, --insecure, --item-help, --keep-tite, --max-input, --no-cancel, --nocancel, --no-items, --no-label, --no-lines, --no-ok, --nook, --no-shadow, --no-tags, --ok-label, --output-fd, --output-separator, --print-maxsize, --print-size, --print-version, --quoted, --separate-output, --separator, --shadow, --single-quoted, --sleep, --stderr, --stdout, --tab-len, --time-format, --title, --version, --yes-label.
Keys: Ctrl-l, F1.
Dialogs: --calendar, --checklist, --form, --gauge, --infobox, --inputbox, --menu, --mixedform, --mixedgauge, --msgbox, --passwordbox, --passwordform, --pause, --radiolist, --rangebox, --textbox, --timebox, --treeview, --yesno.
Some feature differs in input, output, or behavior. Compatibility is not a priority for future development.
π«Ά THANKS TO
Baptiste Daroussin β¨bapt@FreeBSD.orgβ©, Ed Maste β¨emaste@FreeBSD.orgβ©, Juraj Lutter β¨otis@FreeBSD.orgβ© and Trenton Schulz for suggestions, help, and testing.
Source/version cutie: Debian, stamped June 22, 2025, page tag BSDDIALOG(1) β bye bestie, go make your terminal absolutely slay π
β¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2021-2025 Alfonso Sabato Siciliano
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms