GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BSDDIALOG(1) FreeBSD General Commands Manual BSDDIALOG(1)

bsddialogTUI dialogs

bsddialog --help

bsddialog --version

bsddialog [--option] --dialog text rows cols [dialog-argument]

bsddialog --dialog1 ... [--and-dialog --dialog2 ...] ...

The bsddialog utility builds Text User Interface dialogs and widgets: to display messages, to get input and to inform about a computation status.

The options --help and --version print the list of options and the version, respectively, then exit. --and-dialog builds another dialog unless the previous one returns Error, ESC or Cancel.

text is a message printed inside the dialog. rows and cols are the height and width, 0 for autosize and -1 for fullscreen.

The possible input got from the user interface is printed to standard error.

The following options can change the default behavior of the utility and are common to some dialog.

If available set alternate screen mode, see terminfo(5).
Ascii characters to draw lines.
backtitle
Title on the top side of the screen.
x
Dialog horizontal position, 0 is the left screen side, -1 center.
y
Dialog vertical position, 0 is the top screen side, -1 center.
Random settings. Colors. Delimiter and margins around the title. Buttons always active or TAB to switch focus with input components, see --switch-buttons. Zero padding with time or date output.
label
Label for the “Cancel” button.
Hide the dialog at exit.
Clear the screen, after the dialog exit if a dialog is built.
Enable highlights for text, the following sequences are considered escapes:
“\Z0” black.
“\Z1” red.
“\Z2” green.
“\Z3” yellow.
“\Z4” blue.
“\Z5” magenta.
“\Z6” cyan.
“\Z7” white.
“\Zr” reverse foreground and background.
“\ZR” disable reverse.
“\Zb” bold.
“\ZB” disable bold.
“\Zu” underline.
“\ZU” disable underline.
“\Zn” restore normal text.
columns
Try to set the number of columns for a row of text with autosizing; default 10.
Keep new line in text also if it constains a “\n”, see --text-unchanged.
format
String accepted by strftime(3) to customize the output of --datebox and --calendar
label
Focus on the button with label on startup.
name
Focus on the item with name, for Checklist, Menu, Radiolist and Treeview.
Focus on “Cancel” or “No” button on startup.
Disable ESC key to quit.
ESC key returns “Cancel” button value.
Add a button with “Extra” label.
label
Set label for the “Extra” button.
label
Add a button with label.
label
Add a button with label.
Add a button with “Help” label.
label
Set label for “Help” button.
Print the name of the focused item if the Help button is pressed also with --item-bottom-desc.
Print also the selected items if the “Help” button is pressed.
filename
Open filename in a Textbox if F1 key is pressed,
string
Dialog subtitle.
string
Open a Msgbox with string if the F1 key is pressed.
Do not exit with unknown options.
Print ‘*’ to hide passwords while typing; whitespace otherwise.
Set a help string for each item of a Checklist, Form, Menu, Mixedform, Passwordform, Radiolist and Treeview to display at the bottom screen side.
Specify a margin for items, available for Checklist, Menu and Radiolist.
Set a string to prefix each item of a Checklist, Menu, Radiolist or Treeview.
file
Load theme from file.
size
Maximum length of the input for --inputbox ans --passwordbox, default 2048.
Do not show “Cancel” button.
Do not display items desciption, for Checklist, Menu, Radiolist or Treeview.
Do not draw borders and lines.
Do not display items name, for Checklist, Menu and Radiolist.
Do not draw “OK” button.
No not draw the shadow of the dialog.
label
Set label for “OK” button.
If available set normal screen mode, see terminfo(5).
fd
Print input from user interface to the specified file descriptor.
sep
Set a sepator for the items in output, default whitespace.
Screen size. This option can be used without a dialog.
Print Dialog height and widget at exit.
Print version. This option can be used without a dialog.
Quote items in output, default only when necessary.
file
Save the current theme. This option can be used without a dialog.
Separate selected items with a new line and avoid to quote.
Show a pseudo shadow for the dialog, enabled by default.
Use single quote for items in output.
secs
Wait secs seconds to close the dialog.
Print input from user interface to standand error, default.
Print input from user interface to standard output.
enables 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, --calendar and --datebox.
Replace “\t” with a tab in text.
spaces
Number of spaces to print a TAB in text.
By default the text is changed before to be printed. If it contains at least a “\n” each new line and TAB is converted to a space, subsequent spaces are merged. Otherwise new line characters are preserved and a TAB becomes a space. This option disable the text modification.
theme
Set a graphical style: blackwhite, bsddialog, flat or dialog.
format
String accepted by strftime(3) to customize the output of --timebox.
title
Dialog title.

The following dialogs are available:

text rows cols [day month year]
Dialog to select a date.
text 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, 0 for autosize.
text rows cols [day month year]
Dialog to select a date.
text rows cols formrows [label ylabel xlabel init yfield xfield fieldlen maxletters] ...
Dialog to get a list of strings via forms. A form has a label at the position ylabel and xlabel, a field to get the input at the position yfield and xfield with graphical length fieldlen, maxletters is the maximum input length. The field can be customized, if fieldlen is negative the field is read only and its absolute value is the field length. If maxletters is 0 it is the absolute value of fieldlen. init is a default value. formrows is the graphical height of the list, 0 for autosize.
text rows cols [percentage]
Dialog with a bar to shows percentage, then it waits to read “XXX” from the standard input, then the first string replaces percentage and the following strings replace text until the next “XXX”, the loop ends reading EOF.
text rows cols
Dialog without buttons to display a message and to exit immediately.
text rows cols [init]
Dialog to get a string in input, init is the default value.
Builds a menu to select an item from a list, Space key is equivalent to Enter. An item has a name and a desc. The name of the selected item is printed to standard error. menurows is the graphical height of the list, 0 for autosize.
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 a label at the position ylabel and xlabel, a field to get the input with graphical length fieldlen at the position yfield and xfield, maxletters is the maximum input length, init is a default value, flag can be 0 for normal field, 1 to hide the typed characters and 2 to set the field read only. formrows is the graphical height of the list, 0 for autosize.
text rows cols mainperc [minilabel miniperc] ...
Dialog to show a main bar to represent mainperc from 0 to 100 and some mini bar with a minilabel string and a miniperc with value from 0 and 100 or negative to print a descriptive string: -1 “Succeeded”, -2 “Failed”, -3 “Passed”, -4 “Completed”, -5 “Checked”, -6 “Done”, -7 “Skipped”, -8 “In Progress”, -9 a blank line, -10 “N/A”, -11 “Pending”.
text rows cols
Dialog to diplay a message without the “Cancel” button. UP, DOWN, HOME, END, PAGEUP and PAGEDOWN keys are availble to navigate the text.
text rows cols [init]
Dialog to get a password, init is the default value.
text rows cols formrows [label ylabel xlabel init yfield xfield fieldlen maxletters] ...
Dialog to get a list of passwords, equivalent to --form except typed characters are hidden.
text rows cols seconds
Dialog runs until the timeout in seconds expires or a button is pressed.
text rows cols menurows [name desc status] ...
Radiolist to select at most an item from a list via the SPACE key. An item has a name, desc and a default status specified by “on” or “off”. The name of the selected item is printed to standard error. menurows is the graphical height of the list, 0 for autosize.
text rows cols min max [init]
Dialog to select a value between min and max, init is the default value, the keys UP, DOWN, HOME, END, PAGEUP and PAGEDOWN can change it.
file rows cols
Opens and prints file the UP, DOWN, HOME, END, PAGEUP and PAGEDOWN keys are availble to navigate; “OK” button is renamed “EXIT”.
text rows cols [hour min sec]
Dialog to select a time.
text rows cols menurows [depth name desc status] ...
Equivalent to Radiolist with --item-depth and --no-name.
text rows cols
“Yes-No Question”, “OK” and “Cancel” buttons are renamed “Yes” and “No”. UP, DOWN, HOME, END, PAGEUP and PAGEDOWN keys are availble to navigate the text.

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 Generic 1 button.
7 Generic 2 button.

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

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

Outdated options are retained for compatibility, properly equivalent options are used:

Obsolete                     Equivalent
--and-widget                 --and-dialog
--calendar <text> 2 <cols>   --calendar <text> 0 <cols>
--clear                      --clear-screen
--defaultno                  --default-no
--exit-label                 --ok-label
--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

bsddialog(3)

The bsddialog utility first appeared in FreeBSD 14.0.

bsddialog was written by Alfonso Sabato Siciliano <asiciliano@FreeBSD.org>.

bsddialog provides 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.

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.


Baptiste Daroussin <bapt@FreeBSD.org>,
Ed Maste <emaste@FreeBSD.org> and
Juraj Lutter <otis@FreeBSD.org> for suggestions, help, and testing.

September 23, 2022 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.