1DIALOG(1) General Commands Manual DIALOG(1)
2
3
4
6 dialog - display dialog boxes from shell scripts
7
9 dialog --clear
10 dialog --create-rc file
11 dialog --print-maxsize
12 dialog common-options box-options
13
15 Dialog is a program that will let you to present a variety of questions
16 or display messages using dialog boxes from a shell script. These
17 types of dialog boxes are implemented (though not all are necessarily
18 compiled into dialog):
19
20 buildlist, calendar, checklist, dselect, editbox, form, fselect,
21 gauge, infobox, inputbox, inputmenu, menu, mixedform,
22 mixedgauge, msgbox (message), passwordbox, passwordform, pause,
23 prgbox, programbox, progressbox, radiolist, rangebox, tailbox,
24 tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
25
26 You can put more than one dialog box into a script:
27
28 · Use the "--and-widget" token to force dialog to proceed to the next
29 dialog unless you have pressed ESC to cancel, or
30
31 · Simply add the tokens for the next dialog box, making a chain. Di‐
32 alog stops chaining when the return code from a dialog is nonzero,
33 e.g., Cancel or No (see DIAGNOSTICS).
34
35 Some widgets, e.g., checklist, will write text to dialog's output.
36 Normally that is the standard error, but there are options for changing
37 this: "--output-fd", "--stderr" and "--stdout". No text is written if
38 the Cancel button (or ESC) is pressed; dialog exits immediately in that
39 case.
40
42 All options begin with "--" (two ASCII hyphens, for the benefit of
43 those using systems with deranged locale support).
44
45 A "--" by itself is used as an escape, i.e., the next token on the com‐
46 mand-line is not treated as an option.
47 dialog --title -- --Not an option
48
49 The "--args" option tells dialog to list the command-line parameters to
50 the standard error. This is useful when debugging complex scripts us‐
51 ing the "--" and "--file", since the command-line may be rewritten as
52 these are expanded.
53
54 The "--file" option tells dialog to read parameters from the file named
55 as its value.
56 dialog --file parameterfile
57 Blanks not within double-quotes are discarded (use backslashes to quote
58 single characters). The result is inserted into the command-line, re‐
59 placing "--file" and its option value. Interpretation of the command-
60 line resumes from that point. If parameterfile begins with "&", dialog
61 interprets the following text as a file descriptor number rather than a
62 filename.
63
64 Common Options
65 --ascii-lines
66 Rather than draw graphics lines around boxes, draw ASCII "+" and
67 "-" in the same place. See also "--no-lines".
68
69 --aspect ratio
70 This gives you some control over the box dimensions when using
71 auto sizing (specifying 0 for height and width). It represents
72 width / height. The default is 9, which means 9 characters wide
73 to every 1 line high.
74
75 --backtitle backtitle
76 Specifies a backtitle string to be displayed on the backdrop, at
77 the top of the screen.
78
79 --begin y x
80 Specify the position of the upper left corner of a dialog box on
81 the screen.
82
83 --cancel-label string
84 Override the label used for "Cancel" buttons.
85
86 --clear
87 Clears the widget screen, keeping only the screen_color back‐
88 ground. Use this when you combine widgets with "--and-widget"
89 to erase the contents of a previous widget on the screen, so it
90 won't be seen under the contents of a following widget. Under‐
91 stand this as the complement of "--keep-window". To compare the
92 effects, use these:
93
94 All three widgets visible, staircase effect, ordered 1,2,3:
95
96 dialog \
97 --begin 2 2 --yesno "" 0 0 \
98 --and-widget --begin 4 4 --yesno "" 0 0 \
99 --and-widget --begin 6 6 --yesno "" 0 0
100
101 Only the last widget is left visible:
102
103 dialog \
104 --clear --begin 2 2 --yesno "" 0 0 \
105 --and-widget --clear --begin 4 4 --yesno "" 0 0 \
106 --and-widget --begin 6 6 --yesno "" 0 0
107
108 All three widgets visible, staircase effect, ordered 3,2,1:
109
110 dialog \
111 --keep-window --begin 2 2 --yesno "" 0 0 \
112 --and-widget --keep-window --begin 4 4 --yesno "" 0 0 \
113 --and-widget --begin 6 6 --yesno "" 0 0
114
115 First and third widget visible, staircase effect, ordered 3,1:
116
117 dialog \
118 --keep-window --begin 2 2 --yesno "" 0 0 \
119 --and-widget --clear --begin 4 4 --yesno "" 0 0 \
120 --and-widget --begin 6 6 --yesno "" 0 0
121
122 Note, if you want to restore original console colors and send
123 your cursor home after the dialog program has exited, use the
124 clear (1) command.
125
126 --colors
127 Interpret embedded "\Z" sequences in the dialog text by the fol‐
128 lowing character, which tells dialog to set colors or video at‐
129 tributes: 0 through 7 are the ANSI used in curses: black, red,
130 green, yellow, blue, magenta, cyan and white respectively. Bold
131 is set by 'b', reset by 'B'. Reverse is set by 'r', reset by
132 'R'. Underline is set by 'u', reset by 'U'. The settings are
133 cumulative, e.g., "\Zb\Z1" makes the following text bold (per‐
134 haps bright) red. Restore normal settings with "\Zn".
135
136 --column-separator string
137 Tell dialog to split data for radio/checkboxes and menus on the
138 occurrences of the given string, and to align the split data in‐
139 to columns.
140
141 --cr-wrap
142 Interpret embedded newlines in the dialog text as a newline on
143 the screen. Otherwise, dialog will only wrap lines where needed
144 to fit inside the text box.
145
146 Even though you can control line breaks with this, Dialog will
147 still wrap any lines that are too long for the width of the box.
148 Without cr-wrap, the layout of your text may be formatted to
149 look nice in the source code of your script without affecting
150 the way it will look in the dialog.
151
152 See also the "--no-collapse" and "--trim" options.
153
154 --create-rc file
155 When dialog supports run-time configuration, this can be used to
156 dump a sample configuration file to the file specified by file.
157
158 --date-format format
159 If the host provides strftime, this option allows you to specify
160 the format of the date printed for the --calendar widget. The
161 time of day (hour, minute, second) are the current local time.
162
163 --defaultno
164 Make the default value of the yes/no box a No. Likewise, make
165 the default button of widgets that provide "OK" and "Cancel" a
166 Cancel. If "--nocancel" or "--visit-items" are given those op‐
167 tions overrides this, making the default button always "Yes"
168 (internally the same as "OK").
169
170 --default-button string
171 Set the default (preselected) button in a widget. By preselect‐
172 ing a button, a script makes it possible for the user to simply
173 press Enter to proceed through a dialog with minimum interac‐
174 tion.
175
176 The option's value is the name of the button: ok, yes, cancel,
177 no, help or extra.
178
179 Normally the first button in each widget is the default. The
180 first button shown is determined by the widget together with the
181 "--nook" and "--nocancel options. If this option is not given,
182 there is no default button assigned.
183
184 --default-item string
185 Set the default item in a checklist, form or menu box. Normally
186 the first item in the box is the default.
187
188 --exit-label string
189 Override the label used for "EXIT" buttons.
190
191 --extra-button
192 Show an extra button, between "OK" and "Cancel" buttons.
193
194 --extra-label string
195 Override the label used for "Extra" buttons. Note: for input‐
196 menu widgets, this defaults to "Rename".
197
198 --help Prints the help message to the standard output and exits. The
199 help message is also printed if no options are given, or if an
200 unrecognized option is given.
201
202 --help-button
203 Show a help-button after "OK" and "Cancel" buttons, i.e., in
204 checklist, radiolist and menu boxes. If "--item-help" is also
205 given, on exit the return status will be the same as for the
206 "OK" button, and the item-help text will be written to dialog's
207 output after the token "HELP". Otherwise, the return status
208 will indicate that the Help button was pressed, and no message
209 printed.
210
211 --help-label string
212 Override the label used for "Help" buttons.
213
214 --help-status
215 If the help-button is selected, writes the checklist, radiolist
216 or form information after the item-help "HELP" information.
217 This can be used to reconstruct the state of a checklist after
218 processing the help request.
219
220 --hfile filename
221 Display the given file using a textbox when the user presses F1.
222
223 --hline string
224 Display the given string centered at the bottom of the widget.
225
226 --ignore
227 Ignore options that dialog does not recognize. Some well-known
228 ones such as "--icon" are ignored anyway, but this is a better
229 choice for compatibility with other implementations.
230
231 --input-fd fd
232 Read keyboard input from the given file descriptor. Most dialog
233 scripts read from the standard input, but the gauge widget reads
234 a pipe (which is always standard input). Some configurations do
235 not work properly when dialog tries to reopen the terminal. Use
236 this option (with appropriate juggling of file-descriptors) if
237 your script must work in that type of environment.
238
239 --insecure
240 Makes the password widget friendlier but less secure, by echoing
241 asterisks for each character.
242
243 --item-help
244 Interpret the tags data for checklist, radiolist and menu boxes
245 adding a column which is displayed in the bottom line of the
246 screen, for the currently selected item.
247
248 --keep-tite
249 When built with ncurses, dialog normally checks to see if it is
250 running in an xterm, and in that case tries to suppress the ini‐
251 tialization strings that would make it switch to the alternate
252 screen. Switching between the normal and alternate screens is
253 visually distracting in a script which runs dialog several
254 times. Use this option to allow dialog to use those initializa‐
255 tion strings.
256
257 --keep-window
258 Normally when dialog performs several tailboxbg widgets connect‐
259 ed by "--and-widget", it clears the old widget from the screen
260 by painting over it. Use this option to suppress that repaint‐
261 ing.
262
263 At exit, dialog repaints all of the widgets which have been
264 marked with "--keep-window", even if they are not tailboxbg wid‐
265 gets. That causes them to be repainted in reverse order. See
266 the discussion of the "--clear" option for examples.
267
268 --last-key
269 At exit, report the last key which the user entered. This is
270 the curses key code rather than a symbol or literal character.
271 It can be used by scripts to distinguish between two keys which
272 are bound to the same action.
273
274 --max-input size
275 Limit input strings to the given size. If not specified, the
276 limit is 2048.
277
278 --no-cancel
279
280 --nocancel
281 Suppress the "Cancel" button in checklist, inputbox and menu box
282 modes. A script can still test if the user pressed the ESC key
283 to cancel to quit.
284
285 --no-collapse
286 Normally dialog converts tabs to spaces and reduces multiple
287 spaces to a single space for text which is displayed in a mes‐
288 sage boxes, etc. Use this option to disable that feature. Note
289 that dialog will still wrap text, subject to the "--cr-wrap" and
290 "--trim" options.
291
292 --no-items
293 Some widgets (checklist, inputmenu, radiolist, menu) display a
294 list with two columns (a "tag" and "item", i.e., "description").
295 This option tells dialog to read shorter rows, omitting the
296 "item" part of the list. This is occasionally useful, e.g., if
297 the tags provide enough information.
298
299 See also --no-tags. If both options are given, this one is ig‐
300 nored.
301
302 --no-kill
303 Tells dialog to put the tailboxbg box in the background, print‐
304 ing its process id to dialog's output. SIGHUP is disabled for
305 the background process.
306
307 --no-label string
308 Override the label used for "No" buttons.
309
310 --no-lines
311 Rather than draw lines around boxes, draw spaces in the same
312 place. See also "--ascii-lines".
313
314 --no-mouse
315 Do not enable the mouse.
316
317 --no-nl-expand
318 Do not convert "\n" substrings of the message/prompt text into
319 literal newlines.
320
321 --no-ok
322
323 --nook Suppress the "OK" button in checklist, inputbox and menu box
324 modes. A script can still test if the user pressed the "Enter"
325 key to accept the data.
326
327 --no-shadow
328 Suppress shadows that would be drawn to the right and bottom of
329 each dialog box.
330
331 --no-tags
332 Some widgets (checklist, inputmenu, radiolist, menu) display a
333 list with two columns (a "tag" and "description"). The tag is
334 useful for scripting, but may not help the user. The --no-tags
335 option (from Xdialog) may be used to suppress the column of tags
336 from the display. Unlike the --no-items option, this does not
337 affect the data which is read from the script.
338
339 Xdialog does not display the tag column for the analogous
340 buildlist and treeview widgets; dialog does the same.
341
342 Normally dialog allows you to quickly move to entries on the
343 displayed list, by matching a single character to the first
344 character of the tag. When the --no-tags option is given, dia‐
345 log matches against the first character of the description. In
346 either case, the matchable character is highlighted.
347
348 --ok-label string
349 Override the label used for "OK" buttons.
350
351 --output-fd fd
352 Direct output to the given file descriptor. Most dialog scripts
353 write to the standard error, but error messages may also be
354 written there, depending on your script.
355
356 --separator string
357
358 --output-separatorstring
359 Specify a string that will separate the output on dialog's out‐
360 put from checklists, rather than a newline (for --separate-out‐
361 put) or a space. This applies to other widgets such as forms
362 and editboxes which normally use a newline.
363
364 --print-maxsize
365 Print the maximum size of dialog boxes, i.e., the screen size,
366 to dialog's output. This may be used alone, without other op‐
367 tions.
368
369 --print-size
370 Prints the size of each dialog box to dialog's output.
371
372 --print-version
373 Prints dialog's version to dialog's output. This may be used
374 alone, without other options. It does not cause dialog to exit
375 by itself.
376
377 --quoted
378 Normally dialog quotes the strings returned by checklist's as
379 well as the item-help text. Use this option to quote all string
380 results.
381
382 --scrollbar
383 For widgets holding a scrollable set of data, draw a scrollbar
384 on its right-margin. This does not respond to the mouse.
385
386 --separate-output
387 For checklist widgets, output result one line at a time, with no
388 quoting. This facilitates parsing by another program.
389
390 --separate-widget string
391 Specify a string that will separate the output on dialog's out‐
392 put from each widget. This is used to simplify parsing the re‐
393 sult of a dialog with several widgets. If this option is not
394 given, the default separator string is a tab character.
395
396 --shadow
397 Draw a shadow to the right and bottom of each dialog box.
398
399 --single-quoted
400 Use single-quoting as needed (and no quotes if unneeded) for the
401 output of checklist's as well as the item-help text. If this
402 option is not set, dialog uses double quotes around each item.
403 In either case, dialog adds backslashes to make the output use‐
404 ful in shell scripts.
405
406 --size-err
407 Check the resulting size of a dialog box before trying to use
408 it, printing the resulting size if it is larger than the screen.
409 (This option is obsolete, since all new-window calls are
410 checked).
411
412 --sleep secs
413 Sleep (delay) for the given number of seconds after processing a
414 dialog box.
415
416 --stderr
417 Direct output to the standard error. This is the default, since
418 curses normally writes screen updates to the standard output.
419
420 --stdout
421 Direct output to the standard output. This option is provided
422 for compatibility with Xdialog, however using it in portable
423 scripts is not recommended, since curses normally writes its
424 screen updates to the standard output. If you use this option,
425 dialog attempts to reopen the terminal so it can write to the
426 display. Depending on the platform and your environment, that
427 may fail.
428
429 --tab-correct
430 Convert each tab character to one or more spaces (for the
431 textbox widget; otherwise to a single space). Otherwise, tabs
432 are rendered according to the curses library's interpretation.
433
434 --tab-len n
435 Specify the number of spaces that a tab character occupies if
436 the "--tab-correct" option is given. The default is 8. This
437 option is only effective for the textbox widget.
438
439 --time-format format
440 If the host provides strftime, this option allows you to specify
441 the format of the time printed for the --timebox widget. The
442 day, month, year values in this case are for the current local
443 time.
444
445 --timeout secs
446 Timeout (exit with error code) if no user response within the
447 given number of seconds. A timeout of zero seconds is ignored.
448
449 This option is ignored by the "--pause" widget. It is also
450 overridden if the background "--tailboxbg" option is used to
451 setup multiple concurrent widgets.
452
453 --title title
454 Specifies a title string to be displayed at the top of the dia‐
455 log box.
456
457 --trace filename
458 logs the command-line parameters, keystrokes and other informa‐
459 tion to the given file. If dialog reads a configure file, it is
460 logged as well. Piped input to the gauge widget is logged. Use
461 control/T to log a picture of the current dialog window.
462
463 The dialog program handles some command-line parameters specially, and
464 removes them from the parameter list as they are processed. For exam‐
465 ple, if the first option is --trace, then that is processed (and re‐
466 moved) before dialog initializes the display.
467
468 --trim eliminate leading blanks, trim literal newlines and repeated
469 blanks from message text.
470
471 See also the "--cr-wrap" and "--no-collapse" options.
472
473 --version
474 Prints dialog's version to the standard output, and exits. See
475 also "--print-version".
476
477 --visit-items
478 Modify the tab-traversal of checklist, radiolist, menubox and
479 inputmenu to include the list of items as one of the states.
480 This is useful as a visual aid, i.e., the cursor position helps
481 some users.
482
483 When this option is given, the cursor is initially placed on the
484 list. Abbreviations (the first letter of the tag) apply to the
485 list items. If you tab to the button row, abbreviations apply
486 to the buttons.
487
488 --yes-label string
489 Override the label used for "Yes" buttons.
490
491 Box Options
492 All dialog boxes have at least three parameters:
493
494 text the caption or contents of the box.
495
496 height
497 the height of the dialog box.
498
499 width
500 the width of the dialog box.
501
502 Other parameters depend on the box type.
503
504 --buildlist text height width [ tag item status ] ...
505 A buildlist dialog displays two lists, side-by-side. The list
506 on the left shows unselected items. The list on the right shows
507 selected items. As items are selected or unselected, they move
508 between the lists.
509
510 Use a carriage return or the "OK" button to accept the current
511 value in the selected-window and exit. The results are written
512 using the order displayed in the selected-window.
513
514 The initial on/off state of each entry is specified by status.
515
516 The dialog behaves like a menu, using the --visit-items to con‐
517 trol whether the cursor is allowed to visit the lists directly.
518
519 · If --visit-items is not given, tab-traversal uses two states
520 (OK/Cancel).
521
522 · If --visit-items is given, tab-traversal uses four states
523 (Left/Right/OK/Cancel).
524
525 Whether or not --visit--items is given, it is possible to move
526 the highlight between the two lists using the default "^" (left-
527 column) and "$" (right-column) keys.
528
529 On exit, a list of the tag strings of those entries that are
530 turned on will be printed on dialog's output.
531
532 If the "--separate-output" option is not given, the strings will
533 be quoted as needed to make it simple for scripts to separate
534 them. By default, this uses double-quotes. See the "--single-
535 quoted" option, which modifies the quoting behavior.
536
537 --calendar text height width day month year
538 A calendar box displays month, day and year in separately ad‐
539 justable windows. If the values for day, month or year are
540 missing or negative, the current date's corresponding values are
541 used. You can increment or decrement any of those using the
542 left-, up-, right- and down-arrows. Use vi-style h, j, k and l
543 for moving around the array of days in a month. Use tab or
544 backtab to move between windows. If the year is given as zero,
545 the current date is used as an initial value.
546
547 On exit, the date is printed in the form day/month/year. The
548 format can be overridden using the --date-format option.
549
550 --checklist text height width list-height [ tag item status ] ...
551 A checklist box is similar to a menu box; there are multiple en‐
552 tries presented in the form of a menu. Another difference is
553 that you can indicate which entry is currently selected, by set‐
554 ting its status to on. Instead of choosing one entry among the
555 entries, each entry can be turned on or off by the user. The
556 initial on/off state of each entry is specified by status.
557
558 On exit, a list of the tag strings of those entries that are
559 turned on will be printed on dialog's output.
560
561 If the "--separate-output" option is not given, the strings will
562 be quoted as needed to make it simple for scripts to separate
563 them. By default, this uses double-quotes. See the "--single-
564 quoted" option, which modifies the quoting behavior.
565
566 --dselect filepath height width
567 The directory-selection dialog displays a text-entry window in
568 which you can type a directory, and above that a windows with
569 directory names.
570
571 Here filepath can be a filepath in which case the directory win‐
572 dow will display the contents of the path and the text-entry
573 window will contain the preselected directory.
574
575 Use tab or arrow keys to move between the windows. Within the
576 directory window, use the up/down arrow keys to scroll the cur‐
577 rent selection. Use the space-bar to copy the current selection
578 into the text-entry window.
579
580 Typing any printable characters switches focus to the text-entry
581 window, entering that character as well as scrolling the direc‐
582 tory window to the closest match.
583
584 Use a carriage return or the "OK" button to accept the current
585 value in the text-entry window and exit.
586
587 On exit, the contents of the text-entry window are written to
588 dialog's output.
589
590 --editbox filepath height width
591 The edit-box dialog displays a copy of the file. You may edit
592 it using the backspace, delete and cursor keys to correct typing
593 errors. It also recognizes pageup/pagedown. Unlike the --in‐
594 putbox, you must tab to the "OK" or "Cancel" buttons to close
595 the dialog. Pressing the "Enter" key within the box will split
596 the corresponding line.
597
598 On exit, the contents of the edit window are written to dialog's
599 output.
600
601 --form text height width formheight [ label y x item y x flen ilen ] ...
602 The form dialog displays a form consisting of labels and fields,
603 which are positioned on a scrollable window by coordinates given
604 in the script. The field length flen and input-length ilen tell
605 how long the field can be. The former defines the length shown
606 for a selected field, while the latter defines the permissible
607 length of the data entered in the field.
608
609 · If flen is zero, the corresponding field cannot be altered.
610 and the contents of the field determine the displayed-
611 length.
612
613 · If flen is negative, the corresponding field cannot be al‐
614 tered, and the negated value of flen is used as the dis‐
615 played-length.
616
617 · If ilen is zero, it is set to flen.
618
619 Use up/down arrows (or control/N, control/P) to move between
620 fields. Use tab to move between windows.
621
622 On exit, the contents of the form-fields are written to dialog's
623 output, each field separated by a newline. The text used to
624 fill non-editable fields (flen is zero or negative) is not writ‐
625 ten out.
626
627 --fselect filepath height width
628 The fselect (file-selection) dialog displays a text-entry window
629 in which you can type a filename (or directory), and above that
630 two windows with directory names and filenames.
631
632 Here filepath can be a filepath in which case the file and di‐
633 rectory windows will display the contents of the path and the
634 text-entry window will contain the preselected filename.
635
636 Use tab or arrow keys to move between the windows. Within the
637 directory or filename windows, use the up/down arrow keys to
638 scroll the current selection. Use the space-bar to copy the
639 current selection into the text-entry window.
640
641 Typing any printable characters switches focus to the text-entry
642 window, entering that character as well as scrolling the direc‐
643 tory and filename windows to the closest match.
644
645 Typing the space character forces dialog to complete the current
646 name (up to the point where there may be a match against more
647 than one entry).
648
649 Use a carriage return or the "OK" button to accept the current
650 value in the text-entry window and exit.
651
652 On exit, the contents of the text-entry window are written to
653 dialog's output.
654
655 --gauge text height width [percent]
656 A gauge box displays a meter along the bottom of the box. The
657 meter indicates the percentage. New percentages are read from
658 standard input, one integer per line. The meter is updated to
659 reflect each new percentage. If the standard input reads the
660 string "XXX", then the first line following is taken as an inte‐
661 ger percentage, then subsequent lines up to another "XXX" are
662 used for a new prompt. The gauge exits when EOF is reached on
663 the standard input.
664
665 The percent value denotes the initial percentage shown in the
666 meter. If not specified, it is zero.
667
668 On exit, no text is written to dialog's output. The widget ac‐
669 cepts no input, so the exit status is always OK.
670
671 --infobox text height width
672 An info box is basically a message box. However, in this case,
673 dialog will exit immediately after displaying the message to the
674 user. The screen is not cleared when dialog exits, so that the
675 message will remain on the screen until the calling shell script
676 clears it later. This is useful when you want to inform the us‐
677 er that some operations are carrying on that may require some
678 time to finish.
679
680 On exit, no text is written to dialog's output. Only an "OK"
681 button is provided for input, but an ESC exit status may be re‐
682 turned.
683
684 --inputbox text height width [init]
685 An input box is useful when you want to ask questions that re‐
686 quire the user to input a string as the answer. If init is sup‐
687 plied it is used to initialize the input string. When entering
688 the string, the backspace, delete and cursor keys can be used to
689 correct typing errors. If the input string is longer than can
690 fit in the dialog box, the input field will be scrolled.
691
692 On exit, the input string will be printed on dialog's output.
693
694 --inputmenu text height width menu-height [ tag item ] ...
695 An inputmenu box is very similar to an ordinary menu box. There
696 are only a few differences between them:
697
698 1. The entries are not automatically centered but left adjust‐
699 ed.
700
701 2. An extra button (called Rename) is implied to rename the
702 current item when it is pressed.
703
704 3. It is possible to rename the current entry by pressing the
705 Rename button. Then dialog will write the following on dia‐
706 log's output.
707
708 RENAMED <tag> <item>
709
710 --menu text height width menu-height [ tag item ] ...
711 As its name suggests, a menu box is a dialog box that can be
712 used to present a list of choices in the form of a menu for the
713 user to choose. Choices are displayed in the order given. Each
714 menu entry consists of a tag string and an item string. The tag
715 gives the entry a name to distinguish it from the other entries
716 in the menu. The item is a short description of the option that
717 the entry represents. The user can move between the menu en‐
718 tries by pressing the cursor keys, the first letter of the tag
719 as a hot-key, or the number keys 1-9. There are menu-height en‐
720 tries displayed in the menu at one time, but the menu will be
721 scrolled if there are more entries than that.
722
723 On exit the tag of the chosen menu entry will be printed on dia‐
724 log's output. If the "--help-button" option is given, the cor‐
725 responding help text will be printed if the user selects the
726 help button.
727
728 --mixedform text height width formheight [ label y x item y x flen ilen itype ] ...
729 The mixedform dialog displays a form consisting of labels and
730 fields, much like the --form dialog. It differs by adding a
731 field-type parameter to each field's description. Each bit in
732 the type denotes an attribute of the field:
733
734 1 hidden, e.g., a password field.
735
736 2 readonly, e.g., a label.
737
738 --mixedgauge text height width percent [ tag1 item1 ] ...
739 A mixedgauge box displays a meter along the bottom of the box.
740 The meter indicates the percentage.
741
742 It also displays a list of the tag- and item-values at the top
743 of the box. See dialog(3) for the tag values.
744
745 The text is shown as a caption between the list and meter. The
746 percent value denotes the initial percentage shown in the meter.
747
748 No provision is made for reading data from the standard input as
749 --gauge does.
750
751 On exit, no text is written to dialog's output. The widget ac‐
752 cepts no input, so the exit status is always OK.
753
754 --msgbox text height width
755 A message box is very similar to a yes/no box. The only differ‐
756 ence between a message box and a yes/no box is that a message
757 box has only a single OK button. You can use this dialog box to
758 display any message you like. After reading the message, the
759 user can press the ENTER key so that dialog will exit and the
760 calling shell script can continue its operation.
761
762 If the message is too large for the space, dialog may allow you
763 to scroll it, provided that the underlying curses implementation
764 is capable enough. In this case, a percentage is shown in the
765 base of the widget.
766
767 On exit, no text is written to dialog's output. Only an "OK"
768 button is provided for input, but an ESC exit status may be re‐
769 turned.
770
771 --pause text height width seconds
772 A pause box displays a meter along the bottom of the box. The
773 meter indicates how many seconds remain until the end of the
774 pause. The pause exits when timeout is reached or the user
775 presses the OK button (status OK) or the user presses the CANCEL
776 button or Esc key.
777
778 --passwordbox text height width [init]
779 A password box is similar to an input box, except that the text
780 the user enters is not displayed. This is useful when prompting
781 for passwords or other sensitive information. Be aware that if
782 anything is passed in "init", it will be visible in the system's
783 process table to casual snoopers. Also, it is very confusing to
784 the user to provide them with a default password they cannot
785 see. For these reasons, using "init" is highly discouraged.
786 See "--insecure" if you do not care about your password.
787
788 On exit, the input string will be printed on dialog's output.
789
790 --passwordform text height width formheight [ label y x item y x flen ilen ] ...
791 This is identical to --form except that all text fields are
792 treated as password widgets rather than inputbox widgets.
793
794 --prgbox text command height width
795
796 --prgbox command height width
797 A prgbox is very similar to a programbox.
798
799 This dialog box is used to display the output of a command that
800 is specified as an argument to prgbox.
801
802 After the command completes, the user can press the ENTER key so
803 that dialog will exit and the calling shell script can continue
804 its operation.
805
806 If three parameters are given, it displays the text under the
807 title, delineated from the scrolling file's contents. If only
808 two parameters are given, this text is omitted.
809
810 --programbox text height width
811
812 --programbox height width
813 A programbox is very similar to a progressbox. The only differ‐
814 ence between a program box and a progress box is that a program
815 box displays an OK button (but only after the command com‐
816 pletes).
817
818 This dialog box is used to display the piped output of a com‐
819 mand. After the command completes, the user can press the ENTER
820 key so that dialog will exit and the calling shell script can
821 continue its operation.
822
823 If three parameters are given, it displays the text under the
824 title, delineated from the scrolling file's contents. If only
825 two parameters are given, this text is omitted.
826
827 --progressbox text height width
828
829 --progressbox height width
830 A progressbox is similar to an tailbox, except that
831
832 a) rather than displaying the contents of a file,
833 it displays the piped output of a command and
834
835 b) it will exit when it reaches the end of the file
836 (there is no "OK" button).
837
838 If three parameters are given, it displays the text under the
839 title, delineated from the scrolling file's contents. If only
840 two parameters are given, this text is omitted.
841
842 --radiolist text height width list-height [ tag item status ] ...
843 A radiolist box is similar to a menu box. The only difference
844 is that you can indicate which entry is currently selected, by
845 setting its status to on.
846
847 On exit, the tag of the selected item is written to dialog's
848 output.
849
850 --tailbox file height width
851 Display text from a file in a dialog box, as in a "tail -f" com‐
852 mand. Scroll left/right using vi-style 'h' and 'l', or arrow-
853 keys. A '0' resets the scrolling.
854
855 On exit, no text is written to dialog's output. Only an "OK"
856 button is provided for input, but an ESC exit status may be re‐
857 turned.
858
859 --rangebox text height width list-height min-value max-value default-value
860 Allow the user to select from a range of values, e.g., using a
861 slider. The dialog shows the current value as a bar (like the
862 gauge dialog). Tabs or arrow keys move the cursor between the
863 buttons and the value. When the cursor is on the value, you can
864 edit it by:
865
866 left/right cursor movement to select a digit to modify
867
868 +/- characters to increment/decrement the digit by one
869
870 0 through 9
871 to set the digit to the given value
872
873 Some keys are also recognized in all cursor positions:
874
875 home/end
876 set the value to its maximum or minimum
877
878 pageup/pagedown
879 increment the value so that the slider moves by one column
880
881 --tailboxbg file height width
882 Display text from a file in a dialog box as a background task,
883 as in a "tail -f &" command. Scroll left/right using vi-style
884 'h' and 'l', or arrow-keys. A '0' resets the scrolling.
885
886 Dialog treats the background task specially if there are other
887 widgets (--and-widget) on the screen concurrently. Until those
888 widgets are closed (e.g., an "OK"), dialog will perform all of
889 the tailboxbg widgets in the same process, polling for updates.
890 You may use a tab to traverse between the widgets on the screen,
891 and close them individually, e.g., by pressing ENTER. Once the
892 non-tailboxbg widgets are closed, dialog forks a copy of itself
893 into the background, and prints its process id if the "--no-
894 kill" option is given.
895
896 On exit, no text is written to dialog's output. Only an "EXIT"
897 button is provided for input, but an ESC exit status may be re‐
898 turned.
899
900 NOTE: Older versions of dialog forked immediately and attempted
901 to update the screen individually. Besides being bad for per‐
902 formance, it was unworkable. Some older scripts may not work
903 properly with the polled scheme.
904
905 --textbox file height width
906 A text box lets you display the contents of a text file in a di‐
907 alog box. It is like a simple text file viewer. The user can
908 move through the file by using the cursor, page-up, page-down
909 and HOME/END keys available on most keyboards. If the lines are
910 too long to be displayed in the box, the LEFT/RIGHT keys can be
911 used to scroll the text region horizontally. You may also use
912 vi-style keys h, j, k, l in place of the cursor keys, and B or N
913 in place of the page-up and page-down keys. Scroll up/down us‐
914 ing vi-style 'k' and 'j', or arrow-keys. Scroll left/right us‐
915 ing vi-style 'h' and 'l', or arrow-keys. A '0' resets the
916 left/right scrolling. For more convenience, vi-style forward
917 and backward searching functions are also provided.
918
919 On exit, no text is written to dialog's output. Only an "EXIT"
920 button is provided for input, but an ESC exit status may be re‐
921 turned.
922
923 --timebox text height [width hour minute second]
924 A dialog is displayed which allows you to select hour, minute
925 and second. If the values for hour, minute or second are miss‐
926 ing or negative, the current date's corresponding values are
927 used. You can increment or decrement any of those using the
928 left-, up-, right- and down-arrows. Use tab or backtab to move
929 between windows.
930
931 On exit, the result is printed in the form hour:minute:second.
932 The format can be overridden using the --time-format option.
933
934 --treeview text height width list-height [ tag item status depth ] ...
935 Display data organized as a tree. Each group of data contains a
936 tag, the text to display for the item, its status ("on" or
937 "off") and the depth of the item in the tree.
938
939 Only one item can be selected (like the radiolist). The tag is
940 not displayed.
941
942 On exit, the tag of the selected item is written to dialog's
943 output.
944
945 --yesno text height width
946 A yes/no dialog box of size height rows by width columns will be
947 displayed. The string specified by text is displayed inside the
948 dialog box. If this string is too long to fit in one line, it
949 will be automatically divided into multiple lines at appropriate
950 places. The text string can also contain the sub-string "\n" or
951 newline characters `\n' to control line breaking explicitly.
952 This dialog box is useful for asking questions that require the
953 user to answer either yes or no. The dialog box has a Yes but‐
954 ton and a No button, in which the user can switch between by
955 pressing the TAB key.
956
957 On exit, no text is written to dialog's output. In addition to
958 the "Yes" and "No" exit codes (see DIAGNOSTICS) an ESC exit sta‐
959 tus may be returned.
960
961 The codes used for "Yes" and "No" match those used for "OK" and
962 "Cancel", internally no distinction is made.
963
964 Obsolete Options
965 --beep This was used to tell the original cdialog that it should make a
966 beep when the separate processes of the tailboxbg widget would
967 repaint the screen.
968
969 --beep-after
970 Beep after a user has completed a widget by pressing one of the
971 buttons.
972
974 1. Create a sample configuration file by typing:
975
976 "dialog --create-rc <file>"
977
978 2. At start, dialog determines the settings to use as follows:
979
980 a) if environment variable DIALOGRC is set, its value determines
981 the name of the configuration file.
982
983 b) if the file in (a) is not found, use the file $HOME/.dialogrc
984 as the configuration file.
985
986 c) if the file in (b) is not found, try using the GLOBALRC file
987 determined at compile-time, i.e., /etc/dialogrc.
988
989 d) if the file in (c) is not found, use compiled in defaults.
990
991 3. Edit the sample configuration file and copy it to some place that
992 dialog can find, as stated in step 2 above.
993
995 You can override or add to key bindings in dialog by adding to the con‐
996 figuration file. Dialog's bindkey command maps single keys to its in‐
997 ternal coding.
998
999 bindkey widget curses_key dialog_key
1000
1001 The widget name can be "*" (all widgets), or specific widgets such as
1002 textbox. Specific widget bindings override the "*" bindings. User-de‐
1003 fined bindings override the built-in bindings.
1004
1005 The curses_key can be any of the names derived from curses.h, e.g.,
1006 "HELP" from "KEY_HELP". Dialog also recognizes ANSI control characters
1007 such as "^A", "^?", as well as C1-controls such as "~A" and "~?". Fi‐
1008 nally, it allows any single character to be escaped with a backslash.
1009
1010 Dialog's internal keycode names correspond to the DLG_KEYS_ENUM type in
1011 dlg_keys.h, e.g., "HELP" from "DLGK_HELP".
1012
1013 Widget Names
1014 Some widgets (such as the formbox) have an area where fields can be
1015 edited. Those are managed in a subwindow of the widget, and may have
1016 separate keybindings from the main widget because the subwindows are
1017 registered using a different name.
1018
1019 Widget Window name Subwindow Name
1020 calendar calendar
1021 checklist checklist
1022 editbox editbox editbox2
1023 form formbox formfield
1024 fselect fselect fselect2
1025 inputbox inputbox inputbox2
1026 menu menubox menu
1027 msgbox msgbox
1028 pause pause
1029 progressbox progressbox
1030 radiolist radiolist
1031 tailbox tailbox
1032 textbox textbox searchbox
1033 timebox timebox
1034 yesno yesno
1035
1036 Some widgets are actually other widgets, using internal settings to
1037 modify the behavior. Those use the same widget name as the actual wid‐
1038 get:
1039
1040 Widget Actual Widget
1041 dselect fselect
1042 infobox msgbox
1043 inputmenu menu
1044 mixedform form
1045 passwordbox inputbox
1046 passwordform form
1047 prgbox progressbox
1048 programbox progressbox
1049 tailboxbg tailbox
1050
1051 Built-in Bindings
1052 This manual page does not list the key bindings for each widget, be‐
1053 cause that detailed information can be obtained by running dialog. If
1054 you have set the --trace option, dialog writes the key-binding informa‐
1055 tion for each widget as it is registered.
1056
1057 Example
1058 Normally dialog uses different keys for navigating between the buttons
1059 and editing part of a dialog versus navigating within the editing part.
1060 That is, tab (and back-tab) traverse buttons (or between buttons and
1061 the editing part), while arrow keys traverse fields within the editing
1062 part. Tabs are also recognized as a special case for traversing be‐
1063 tween widgets, e.g., when using multiple tailboxbg widgets.
1064
1065 Some users may wish to use the same key for traversing within the edit‐
1066 ing part as for traversing between buttons. The form widget is written
1067 to support this sort of redefinition of the keys, by adding a special
1068 group in <code>dlgk_keys.h</code> for "form" (left/right/next/prev).
1069 Here is an example binding demonstrating how to do this:
1070
1071 bindkey formfield TAB form_NEXT
1072 bindkey formbox TAB form_NEXT
1073 bindkey formfield BTAB form_prev
1074 bindkey formbox BTAB form_prev
1075
1076 That type of redefinition would not be useful in other widgets, e.g.,
1077 calendar, due to the potentially large number of fields to traverse.
1078
1080 DIALOGOPTS Define this variable to apply any of the common options
1081 to each widget. Most of the common options are reset
1082 before processing each widget. If you set the options
1083 in this environment variable, they are applied to dia‐
1084 log's state after the reset. As in the "--file" option,
1085 double-quotes and backslashes are interpreted.
1086
1087 The "--file" option is not considered a common option
1088 (so you cannot embed it within this environment vari‐
1089 able).
1090
1091 DIALOGRC Define this variable if you want to specify the name of
1092 the configuration file to use.
1093
1094 DIALOG_CANCEL
1095
1096 DIALOG_ERROR
1097
1098 DIALOG_ESC
1099
1100 DIALOG_EXTRA
1101
1102 DIALOG_HELP
1103
1104 DIALOG_ITEM_HELP
1105
1106 DIALOG_OK Define any of these variables to change the exit code on
1107 Cancel (1), error (-1), ESC (255), Extra (3), Help (2),
1108 Help with --item-help (2), or OK (0). Normally shell
1109 scripts cannot distinguish between -1 and 255.
1110
1111 DIALOG_TTY Set this variable to "1" to provide compatibility with
1112 older versions of dialog which assumed that if the
1113 script redirects the standard output, that the "--std‐
1114 out" option was given.
1115
1117 $HOME/.dialogrc default configuration file
1118
1120 The dialog sources contain several samples of how to use the different
1121 box options and how they look. Just take a look into the directory
1122 samples/ of the source.
1123
1125 Exit status is subject to being overridden by environment variables.
1126 The default values and corresponding environment variables that can
1127 override them are:
1128
1129 0 if dialog is exited by pressing the Yes or OK button (DIALOG_OK).
1130
1131 1 if the No or Cancel button is pressed (DIALOG_CANCEL).
1132
1133 2 if the Help button is pressed (DIALOG_HELP).
1134
1135 3 if the Extra button is pressed (DIALOG_EXTRA).
1136
1137 4 if the Help button is pressed (DIALOG_HELP), or the --item-help
1138 option is set when the Help button is pressed (DIALOG_ITEM_HELP),
1139
1140 -1 if errors occur inside dialog (DIALOG_ERROR) or dialog is exited
1141 by pressing the ESC key (DIALOG_ESC).
1142
1144 Dialog works with X/Open curses. However, some implementations have
1145 deficiencies:
1146
1147 · HPUX curses (and perhaps others) do not open the terminal prop‐
1148 erly for the newterm function. This interferes with dialog's
1149 --input-fd option, by preventing cursor-keys and similar escape
1150 sequences from being recognized.
1151
1152 · NetBSD 5.1 curses has incomplete support for wide-characters.
1153 dialog will build, but not all examples display properly.
1154
1156 You may want to write scripts which run with other dialog "clones".
1157
1158 ORIGINAL DIALOG
1159 First, there is the "original" dialog program to consider (versions 0.3
1160 to 0.9). It had some misspelled (or inconsistent) options. The dialog
1161 program maps those deprecated options to the preferred ones. They in‐
1162 clude:
1163
1164 Option Treatment
1165 ─────────────────────────────────
1166 --beep-after ignored
1167 --guage mapped to --gauge
1168
1169 XDIALOG
1170 Technically, "Xdialog", this is an X application. With some care, it
1171 is possible to write useful scripts that work with both Xdialog and di‐
1172 alog.
1173
1174 The dialog program ignores these options which are recognized by Xdia‐
1175 log:
1176
1177 Option Treatment
1178 ───────────────────────────────────────────────
1179 --allow-close ignored
1180 --auto-placement ignored
1181 --fixed-font ignored
1182 --icon ignored
1183 --keep-colors ignored
1184 --no-close ignored
1185 --no-cr-wrap ignored
1186 --screen-center ignored
1187 --separator mapped to --separate-output
1188 --smooth ignored
1189 --under-mouse ignored
1190 --wmclass ignored
1191
1192 Xdialog's manpage has a section discussing its compatibility with dia‐
1193 log. There are some differences not shown in the manpage. For exam‐
1194 ple, the html documentation states
1195
1196 Note: former Xdialog releases used the "0 (line feed) as a
1197 results separator for the checklist widget; this has been
1198 changed to "/" in Xdialog v1.5.0 so to make it compatible
1199 with (c)dialog. In your old scripts using the Xdialog check‐
1200 list, you will then have to add the --separate-output op‐
1201 tion before the --checklist one.
1202
1203 Dialog has not used a different separator; the difference was likely
1204 due to confusion regarding some script.
1205
1206 WHIPTAIL
1207 Then there is whiptail. For practical purposes, it is maintained by
1208 Debian (very little work is done by its upstream developers). Its doc‐
1209 umentation (README.whiptail) claims
1210
1211 whiptail(1) is a lightweight replacement for dialog(1),
1212 to provide dialog boxes for shell scripts.
1213 It is built on the
1214 newt windowing library rather than the ncurses library, allowing
1215 it to be smaller in embedded enviroments such as installers,
1216 rescue disks, etc.
1217
1218 whiptail is designed to be drop-in compatible with dialog, but
1219 has less features: some dialog boxes are not implemented, such
1220 as tailbox, timebox, calendarbox, etc.
1221
1222 Comparing actual sizes (Debian testing, 2007/1/10): The total of sizes
1223 for whiptail, the newt, popt and slang libraries is 757kb. The compa‐
1224 rable number for dialog (counting ncurses) is 520kb. Disregard the
1225 first paragraph.
1226
1227 The second paragraph is misleading, since whiptail also does not work
1228 for common options of dialog, such as the gauge box. whiptail is less
1229 compatible with dialog than the original mid-1990s dialog 0.4 program.
1230
1231 whiptail's manpage borrows features from dialog, e.g., but oddly cites
1232 only dialog versions up to 0.4 (1994) as a source. That is, its man‐
1233 page refers to features which were borrowed from more recent versions
1234 of dialog, e.g.,
1235
1236 · --gauge (from 0.5)
1237
1238 · --passwordbox (from Debian changes in 1999),
1239
1240 · --default-item (from dialog 2000/02/22),
1241
1242 · --output-fd (from dialog 2002/08/14).
1243
1244 Somewhat humorously, one may note that the popt feature (undocumented
1245 in its manpage) of using a "--" as an escape was documented in dialog's
1246 manpage about a year before it was mentioned in whiptail's manpage.
1247 whiptail's manpage incorrectly attributes that to getopt (and is inac‐
1248 curate anyway).
1249
1250 Debian uses whiptail for the official dialog variation.
1251
1252 The dialog program ignores or maps these options which are recognized
1253 by whiptail:
1254
1255 Option Treatment
1256 ───────────────────────────────────────────
1257 --cancel-button mapped to --cancel-label
1258 --fb ignored
1259 --fullbutton ignored
1260 --no-button mapped to --no-label
1261 --nocancel mapped to --no-cancel
1262 --noitem mapped to --no-items
1263 --notags mapped to --no-tags
1264 --ok-button mapped to --ok-label
1265 --scrolltext mapped to --scrollbar
1266 --topleft mapped to --begin 0 0
1267 --yes-button mapped to --yes-label
1268
1269 There are visual differences which are not addressed by command-line
1270 options:
1271
1272 · dialog centers lists within the window. whiptail typically puts
1273 lists against the left margin.
1274
1275 · whiptail uses angle brackets ("<" and ">") for marking buttons.
1276 dialog uses square brackets.
1277
1278 · whiptail marks the limits of subtitles with vertical bars. dialog
1279 does not mark the limits.
1280
1281 · whiptail attempts to mark the top/bottom cells of a scrollbar with
1282 up/down arrows. When it cannot do this, it fills those cells with
1283 the background color of the scrollbar and confusing the user. dia‐
1284 log uses the entire scrollbar space, thereby getting better resolu‐
1285 tion.
1286
1288 Perhaps.
1289
1291 Thomas E. Dickey (updates for 0.9b and beyond)
1292
1294 Kiran Cherupally - the mixed form and mixed gauge widgets.
1295
1296 Tobias C. Rittweiler
1297
1298 Valery Reznic - the form and progressbox widgets.
1299
1300 Yura Kalinichenko adapted the gauge widget as "pause".
1301
1302 This is a rewrite (except as needed to provide compatibility) of the
1303 earlier version of dialog 0.9a, which lists as authors:
1304
1305 · Savio Lam - version 0.3, "dialog"
1306
1307 · Stuart Herbert - patch for version 0.4
1308
1309 · Marc Ewing - the gauge widget.
1310
1311 · Pasquale De Marco "Pako" - version 0.9a, "cdialog"
1312
1313
1314
1315$Date: 2013/03/15 09:07:30 $ DIALOG(1)