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 calendar, checklist, dselect, editbox, form, fselect, gauge,
21 infobox, inputbox, inputmenu, menu, mixedform, mixedgauge,
22 msgbox (message), passwordbox, passwordform, pause, progressbox,
23 radiolist, tailbox, tailboxbg, textbox, timebox, and yesno
24 (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
29 next dialog unless you have pressed ESC to cancel, or
30
31 - Simply add the tokens for the next dialog box, making a chain.
32 Dialog stops chaining when the return code from a dialog is nonze‐
33 ro, 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 dialog --begin 2 2 --yesno "" 0 0 \
96 --and-widget --begin 4 4 --yesno "" 0 0 \
97 --and-widget --begin 6 6 --yesno "" 0 0
98
99 Only the last widget is left visible:
100 dialog --clear --begin 2 2 --yesno "" 0 0 \
101 --and-widget --clear --begin 4 4 --yesno "" 0 0 \
102 --and-widget --begin 6 6 --yesno "" 0 0
103
104 All three widgets visible, staircase effect, ordered 3,2,1:
105 dialog --keep-window --begin 2 2 --yesno "" 0 0 \
106 --and-widget --keep-window --begin 4 4 --yesno "" 0 0 \
107 --and-widget --begin 6 6 --yesno "" 0 0
108
109 First and third widget visible, staircase effect, ordered 3,1:
110 dialog --keep-window --begin 2 2 --yesno "" 0 0 \
111 --and-widget --clear --begin 4 4 --yesno "" 0 0 \
112 --and-widget --begin 6 6 --yesno "" 0 0
113
114 Note, if you want to restore original console colors and send
115 your cursor home after the dialog program has exited, use the
116 clear (1) command.
117
118 --colors
119 Interpret embedded "\Z" sequences in the dialog text by the fol‐
120 lowing character, which tells dialog to set colors or video
121 attributes: 0 through 7 are the ANSI used in curses: black, red,
122 green, yellow, blue, magenta, cyan and white respectively. Bold
123 is set by 'b', reset by 'B'. Reverse is set by 'r', reset by
124 'R'. Underline is set by 'u', reset by 'U'. The settings are
125 cumulative, e.g., "\Zb\Z1" makes the following text bold (per‐
126 haps bright) red. Restore normal settings with "\Zn".
127
128 --column-separator string
129 Tell dialog to split data for radio/checkboxes and menus on the
130 occurrences of the given string, and to align the split data
131 into columns.
132
133 --cr-wrap
134 Interpret embedded newlines in the dialog text as a newline on
135 the screen. Otherwise, dialog will only wrap lines where needed
136 to fit inside the text box. Even though you can control line
137 breaks with this, dialog will still wrap any lines that are too
138 long for the width of the box. Without cr-wrap, the layout of
139 your text may be formatted to look nice in the source code of
140 your script without affecting the way it will look in the dia‐
141 log.
142
143 See also the "--no-collapse" and "--trim" options.
144
145 --create-rc file
146 When dialog supports run-time configuration, this can be used to
147 dump a sample configuration file to the file specified by file.
148
149 --defaultno
150 Make the default value of the yes/no box a No. Likewise, make
151 the default button of widgets that provide "OK" and "Cancel" a
152 Cancel. If "--nocancel" or "--visit-items" are given those
153 options overrides this, making the default button always "Yes"
154 (internally the same as "OK").
155
156 --default-item string
157 Set the default item in a checklist, form or menu box. Normally
158 the first item in the box is the default.
159
160 --exit-label string
161 Override the label used for "EXIT" buttons.
162
163 --extra-button
164 Show an extra button, between "OK" and "Cancel" buttons.
165
166 --extra-label string
167 Override the label used for "Extra" buttons. Note: for input‐
168 menu widgets, this defaults to "Rename".
169
170 --help Prints the help message to dialog's output. The help message is
171 printed if no options are given.
172
173 --help-button
174 Show a help-button after "OK" and "Cancel" buttons, i.e., in
175 checklist, radiolist and menu boxes. If "--item-help" is also
176 given, on exit the return status will be the same as for the
177 "OK" button, and the item-help text will be written to dialog's
178 output after the token "HELP". Otherwise, the return status
179 will indicate that the Help button was pressed, and no message
180 printed.
181
182 --help-label string
183 Override the label used for "Help" buttons.
184
185 --help-status
186 If the help-button is selected, writes the checklist, radiolist
187 or form information after the item-help "HELP" information.
188 This can be used to reconstruct the state of a checklist after
189 processing the help request.
190
191 --ignore
192 Ignore options that dialog does not recognize. Some well-known
193 ones such as "--icon" are ignored anyway, but this is a better
194 choice for compatibility with other implementations.
195
196 --input-fd fd
197 Read keyboard input from the given file descriptor. Most dialog
198 scripts read from the standard input, but the gauge widget reads
199 a pipe (which is always standard input). Some configurations do
200 not work properly when dialog tries to reopen the terminal. Use
201 this option (with appropriate juggling of file-descriptors) if
202 your script must work in that type of environment.
203
204 --insecure
205 Makes the password widget friendlier but less secure, by echoing
206 asterisks for each character.
207
208 --item-help
209 Interpret the tags data for checklist, radiolist and menu boxes
210 adding a column which is displayed in the bottom line of the
211 screen, for the currently selected item.
212
213 --keep-tite
214 Normally dialog checks to see if it is running in an xterm, and
215 in that case tries to suppress the initialization strings that
216 would make it switch to the alternate screen. Switching between
217 the normal and alternate screens is visually distracting in a
218 script which runs dialog several times. Use this option to
219 allow dialog to use those initialization strings.
220
221 --keep-window
222 Normally when dialog performs several tailboxbg widgets con‐
223 nected by "--and-widget", it clears the old widget from the
224 screen by painting over it. Use this option to suppress that
225 repainting.
226
227 At exit, dialog repaints all of the widgets which have been
228 marked with "--keep-window", even if they are not tailboxbg wid‐
229 gets. That causes them to be repainted in reverse order. See
230 the discussion of the "--clear" option for examples.
231
232 --max-input size
233 Limit input strings to the given size. If not specified, the
234 limit is 2048.
235
236 --no-cancel
237
238 --nocancel
239 Suppress the "Cancel" button in checklist, inputbox and menu box
240 modes. A script can still test if the user pressed the ESC key
241 to cancel to quit.
242
243 --no-collapse
244 Normally dialog converts tabs to spaces and reduces multiple
245 spaces to a single space for text which is displayed in a mes‐
246 sage boxes, etc. Use this option to disable that feature. Note
247 that dialog will still wrap text, subject to the "--cr-wrap" and
248 "--trim" options.
249
250 --no-kill
251 Tells dialog to put the tailboxbg box in the background, print‐
252 ing its process id to dialog's output. SIGHUP is disabled for
253 the background process.
254
255 --no-label string
256 Override the label used for "No" buttons.
257
258 --no-lines
259 Rather than draw lines around boxes, draw spaces in the same
260 place. See also "--ascii-lines".
261
262 --no-ok
263
264 --nook Suppress the "OK" button in checklist, inputbox and menu box
265 modes. A script can still test if the user pressed the "Enter"
266 key to accept the data.
267
268 --no-shadow
269 Suppress shadows that would be drawn to the right and bottom of
270 each dialog box.
271
272 --ok-label string
273 Override the label used for "OK" buttons.
274
275 --output-fd fd
276 Direct output to the given file descriptor. Most dialog scripts
277 write to the standard error, but error messages may also be
278 written there, depending on your script.
279
280 --separator string
281
282 --output-separatorstring
283 Specify a string that will separate the output on dialog's out‐
284 put from checklists, rather than a newline (for --separate-out‐
285 put) or a space. This applies to other widgets such as forms
286 and editboxes which normally use a newline.
287
288 --print-maxsize
289 Print the maximum size of dialog boxes, i.e., the screen size,
290 to dialog's output. This may be used alone, without other
291 options.
292
293 --print-size
294 Prints the size of each dialog box to dialog's output.
295
296 --print-version
297 Prints dialog's version to dialog's output. This may be used
298 alone, without other options.
299
300 --separate-output
301 For checklist widgets, output result one line at a time, with no
302 quoting. This facilitates parsing by another program.
303
304 --separate-widget string
305 Specify a string that will separate the output on dialog's out‐
306 put from each widget. This is used to simplify parsing the
307 result of a dialog with several widgets. If this option is not
308 given, the default separator string is a tab character.
309
310 --shadow
311 Draw a shadow to the right and bottom of each dialog box.
312
313 --single-quoted
314 Use single-quoting as needed (and no quotes if unneeded) for the
315 output of checklist's as well as the item-help text. If this
316 option is not set, dialog uses double quotes around each item.
317 That requires occasional use of backslashes to make the output
318 useful in shell scripts.
319
320 --size-err
321 Check the resulting size of a dialog box before trying to use
322 it, printing the resulting size if it is larger than the screen.
323 (This option is obsolete, since all new-window calls are
324 checked).
325
326 --sleep secs
327 Sleep (delay) for the given number of seconds after processing a
328 dialog box.
329
330 --stderr
331 Direct output to the standard error. This is the default, since
332 curses normally writes screen updates to the standard output.
333
334 --stdout
335 Direct output to the standard output. This option is provided
336 for compatibility with Xdialog, however using it in portable
337 scripts is not recommended, since curses normally writes its
338 screen updates to the standard output. If you use this option,
339 dialog attempts to reopen the terminal so it can write to the
340 display. Depending on the platform and your environment, that
341 may fail.
342
343 --tab-correct
344 Convert each tab character to one or more spaces (for the
345 textbox widget; otherwise to a single space). Otherwise, tabs
346 are rendered according to the curses library's interpretation.
347
348 --tab-len n
349 Specify the number of spaces that a tab character occupies if
350 the "--tab-correct" option is given. The default is 8. This
351 option is only effective for the textbox widget.
352
353 --timeout secs
354 Timeout (exit with error code) if no user response within the
355 given number of seconds. This is overridden if the background
356 "--tailboxbg is used. A timeout of zero seconds is ignored.
357
358 --title title
359 Specifies a title string to be displayed at the top of the dia‐
360 log box.
361
362 --trace filename
363 logs keystrokes to the given file. Use control/T to log a pic‐
364 ture of the current dialog window.
365
366 --trim eliminate leading blanks, trim literal newlines and repeated
367 blanks from message text.
368
369 See also the "--cr-wrap" and "--no-collapse" options.
370
371 --version
372 Same as "--print-version".
373
374 --visit-items
375 Modify the tab-traversal of checklist, radiobox, menubox and
376 inputmenu to include the list of items as one of the states.
377 This is useful as a visual aid, i.e., the cursor position helps
378 some users.
379
380 When this option is given, the cursor is initially placed on the
381 list. Abbreviations (the first letter of the tag) apply to the
382 list items. If you tab to the button row, abbreviations apply
383 to the buttons.
384
385 --yes-label string
386 Override the label used for "Yes" buttons.
387
388 Box Options
389 All dialog boxes have at least three parameters:
390
391 text the caption or contents of the box.
392
393 height
394 the height of the dialog box.
395
396 width
397 the width of the dialog box.
398
399 Other parameters depend on the box type.
400
401 --calendar text height width day month year
402 A calendar box displays month, day and year in separately
403 adjustable windows. If the values for day, month or year are
404 missing or negative, the current date's corresponding values are
405 used. You can increment or decrement any of those using the
406 left-, up-, right- and down-arrows. Use vi-style h, j, k and l
407 for moving around the array of days in a month. Use tab or
408 backtab to move between windows. If the year is given as zero,
409 the current date is used as an initial value.
410
411 On exit, the date is printed in the form day/month/year.
412
413 --checklist text height width list-height [ tag item status ] ...
414 A checklist box is similar to a menu box; there are multiple
415 entries presented in the form of a menu. Instead of choosing
416 one entry among the entries, each entry can be turned on or off
417 by the user. The initial on/off state of each entry is speci‐
418 fied by status.
419
420 On exit, a list of the tag strings of those entries that are
421 turned on will be printed on dialog's output. If the "--sepa‐
422 rate-output" option is not given, the strings will be quoted to
423 make it simple for scripts to separate them. See the "--single-
424 quoted" option, which modifies the quoting behavior.
425
426 --dselect filepath height width
427 The directory-selection dialog displays a text-entry window in
428 which you can type a directory, and above that a windows with
429 directory names.
430
431 Here filepath can be a filepath in which case the directory win‐
432 dow will display the contents of the path and the text-entry
433 window will contain the preselected directory.
434
435 Use tab or arrow keys to move between the windows. Within the
436 directory window, use the up/down arrow keys to scroll the cur‐
437 rent selection. Use the space-bar to copy the current selection
438 into the text-entry window.
439
440 Typing any printable characters switches focus to the text-entry
441 window, entering that character as well as scrolling the direc‐
442 tory window to the closest match.
443
444 Use a carriage return or the "OK" button to accept the current
445 value in the text-entry window and exit.
446
447 On exit, the contents of the text-entry window are written to
448 dialog's output.
449
450 --editbox filepath height width
451 The edit-box dialog displays a copy of the file. You may edit
452 it using the backspace, delete and cursor keys to correct typing
453 errors. It also recognizes pageup/pagedown. Unlike the
454 --inputbox, you must tab to the "OK" or "Cancel" buttons to
455 close the dialog. Pressing the "Enter" key within the box will
456 split the corresponding line.
457
458 On exit, the contents of the edit window are written to dialog's
459 output.
460
461 --form text height width formheight [ label y x item y x flen ilen ] ...
462 The form dialog displays a form consisting of labels and fields,
463 which are positioned on a scrollable window by coordinates given
464 in the script. The field length flen and input-length ilen tell
465 how long the field can be. The former defines the length shown
466 for a selected field, while the latter defines the permissible
467 length of the data entered in the field.
468
469 - If flen is zero, the corresponding field cannot be altered.
470 and the contents of the field determine the displayed-length.
471
472 - If flen is negative, the corresponding field cannot be
473 altered, and the negated value of flen is used as the dis‐
474 played-length.
475
476 - If ilen is zero, it is set to flen.
477
478 Use up/down arrows (or control/N, control/P) to move between
479 fields. Use tab to move between windows.
480
481 On exit, the contents of the form-fields are written to dialog's
482 output, each field separated by a newline. The text used to
483 fill non-editable fields (flen is zero or negative) is not writ‐
484 ten out.
485
486 --fselect filepath height width
487 The fselect (file-selection) dialog displays a text-entry window
488 in which you can type a filename (or directory), and above that
489 two windows with directory names and filenames.
490
491 Here filepath can be a filepath in which case the file and
492 directory windows will display the contents of the path and the
493 text-entry window will contain the preselected filename.
494
495 Use tab or arrow keys to move between the windows. Within the
496 directory or filename windows, use the up/down arrow keys to
497 scroll the current selection. Use the space-bar to copy the
498 current selection into the text-entry window.
499
500 Typing any printable characters switches focus to the text-entry
501 window, entering that character as well as scrolling the direc‐
502 tory and filename windows to the closest match.
503
504 Typing the space character forces dialog to complete the current
505 name (up to the point where there may be a match against more
506 than one entry).
507
508 Use a carriage return or the "OK" button to accept the current
509 value in the text-entry window and exit.
510
511 On exit, the contents of the text-entry window are written to
512 dialog's output.
513
514 --gauge text height width [percent]
515 A gauge box displays a meter along the bottom of the box. The
516 meter indicates the percentage. New percentages are read from
517 standard input, one integer per line. The meter is updated to
518 reflect each new percentage. If the standard input reads the
519 string "XXX", then the first line following is taken as an inte‐
520 ger percentage, then subsequent lines up to another "XXX" are
521 used for a new prompt. The gauge exits when EOF is reached on
522 the standard input.
523
524 The percent value denotes the initial percentage shown in the
525 meter. If not specified, it is zero.
526
527 On exit, no text is written to dialog's output. The widget
528 accepts no input, so the exit status is always OK.
529
530 --infobox text height width
531 An info box is basically a message box. However, in this case,
532 dialog will exit immediately after displaying the message to the
533 user. The screen is not cleared when dialog exits, so that the
534 message will remain on the screen until the calling shell script
535 clears it later. This is useful when you want to inform the
536 user that some operations are carrying on that may require some
537 time to finish.
538
539 On exit, no text is written to dialog's output. Only an "OK"
540 button is provided for input, but an ESC exit status may be
541 returned.
542
543 --inputbox text height width [init]
544 An input box is useful when you want to ask questions that
545 require the user to input a string as the answer. If init is
546 supplied it is used to initialize the input string. When enter‐
547 ing the string, the backspace, delete and cursor keys can be
548 used to correct typing errors. If the input string is longer
549 than can fit in the dialog box, the input field will be
550 scrolled.
551
552 On exit, the input string will be printed on dialog's output.
553
554 --inputmenu text height width menu-height [ tag item ] ...
555 An inputmenu box is very similar to an ordinary menu box. There
556 are only a few differences between them:
557
558 1. The entries are not automatically centered but left
559 adjusted.
560
561 2. An extra button (called Rename) is implied to rename the
562 current item when it is pressed.
563
564 3. It is possible to rename the current entry by pressing the
565 Rename button. Then dialog will write the following on dia‐
566 log's output.
567
568 RENAMED <tag> <item>
569
570 --menu text height width menu-height [ tag item ] ...
571 As its name suggests, a menu box is a dialog box that can be
572 used to present a list of choices in the form of a menu for the
573 user to choose. Choices are displayed in the order given. Each
574 menu entry consists of a tag string and an item string. The tag
575 gives the entry a name to distinguish it from the other entries
576 in the menu. The item is a short description of the option that
577 the entry represents. The user can move between the menu
578 entries by pressing the cursor keys, the first letter of the tag
579 as a hot-key, or the number keys 1-9. There are menu-height
580 entries displayed in the menu at one time, but the menu will be
581 scrolled if there are more entries than that.
582
583 On exit the tag of the chosen menu entry will be printed on dia‐
584 log's output. If the "--help-button" option is given, the cor‐
585 responding help text will be printed if the user selects the
586 help button.
587
588 --mixedform text height width formheight [ label y x item y x flen ilen itype ] ...
589 The mixedform dialog displays a form consisting of labels and
590 fields, much like the --form dialog. It differs by adding a
591 field-type parameter to each field's description. Each bit in
592 the type denotes an attribute of the field:
593
594 1 hidden, e.g., a password field.
595
596 2 readonly, e.g., a label.
597
598 --mixedgauge text height width percent [ tag1 item1 ] ...
599 A mixedgauge box displays a meter along the bottom of the box.
600 The meter indicates the percentage.
601
602 It also displays a list of the tag- and item-values at the top
603 of the box. See dialog(3) for the tag values.
604
605 The text is shown as a caption between the list and meter. The
606 percent value denotes the initial percentage shown in the meter.
607
608 No provision is made for reading data from the standard input as
609 --gauge does.
610
611 On exit, no text is written to dialog's output. The widget
612 accepts no input, so the exit status is always OK.
613
614 --msgbox text height width
615 A message box is very similar to a yes/no box. The only differ‐
616 ence between a message box and a yes/no box is that a message
617 box has only a single OK button. You can use this dialog box to
618 display any message you like. After reading the message, the
619 user can press the ENTER key so that dialog will exit and the
620 calling shell script can continue its operation.
621
622 If the message is too large for the space, dialog may allow you
623 to scroll it, provided that the underlying curses implementation
624 is capable enough. In this case, a percentage is shown in the
625 base of the widget.
626
627 On exit, no text is written to dialog's output. Only an "OK"
628 button is provided for input, but an ESC exit status may be
629 returned.
630
631 --pause text height width seconds
632 A pause box displays a meter along the bottom of the box. The
633 meter indicates how many seconds remain until the end of the
634 pause. The pause exits when timeout is reached or the user
635 presses the OK button (status OK) or the user presses the CANCEL
636 button or Esc key.
637
638 --passwordbox text height width [init]
639 A password box is similar to an input box, except that the text
640 the user enters is not displayed. This is useful when prompting
641 for passwords or other sensitive information. Be aware that if
642 anything is passed in "init", it will be visible in the system's
643 process table to casual snoopers. Also, it is very confusing to
644 the user to provide them with a default password they cannot
645 see. For these reasons, using "init" is highly discouraged.
646 See "--insecure" if you do not care about your password.
647
648 On exit, the input string will be printed on dialog's output.
649
650 --passwordform text height width formheight [ label y x item y x flen ilen ] ...
651 This is identical to --form except that all text fields are
652 treated as password widgets rather than inputbox widgets.
653
654 --progressbox text height width
655
656 --progressbox height width
657 A progressbox is similar to an tailbox, except that it will exit
658 when it reaches the end of the file. If three parameters are
659 given, it displays the text under the title, delineated from the
660 scrolling file's contents. If only two parameters are given,
661 this text is omitted.
662
663 --radiolist text height width list-height [ tag item status ] ...
664 A radiolist box is similar to a menu box. The only difference
665 is that you can indicate which entry is currently selected, by
666 setting its status to on.
667
668 On exit, the name of the selected item is written to dialog's
669 output.
670
671 --tailbox file height width
672 Display text from a file in a dialog box, as in a "tail -f" com‐
673 mand. Scroll left/right using vi-style 'h' and 'l', or arrow-
674 keys. A '0' resets the scrolling.
675
676 On exit, no text is written to dialog's output. Only an "OK"
677 button is provided for input, but an ESC exit status may be
678 returned.
679
680 --tailboxbg file height width
681 Display text from a file in a dialog box as a background task,
682 as in a "tail -f &" command. Scroll left/right using vi-style
683 'h' and 'l', or arrow-keys. A '0' resets the scrolling.
684
685 Dialog treats the background task specially if there are other
686 widgets (--and-widget) on the screen concurrently. Until those
687 widgets are closed (e.g., an "OK"), dialog will perform all of
688 the tailboxbg widgets in the same process, polling for updates.
689 You may use a tab to traverse between the widgets on the screen,
690 and close them individually, e.g., by pressing ENTER. Once the
691 non-tailboxbg widgets are closed, dialog forks a copy of itself
692 into the background, and prints its process id if the "--no-
693 kill" option is given.
694
695 On exit, no text is written to dialog's output. Only an "EXIT"
696 button is provided for input, but an ESC exit status may be
697 returned.
698
699 NOTE: Older versions of dialog forked immediately and attempted
700 to update the screen individually. Besides being bad for per‐
701 formance, it was unworkable. Some older scripts may not work
702 properly with the polled scheme.
703
704 --textbox file height width
705 A text box lets you display the contents of a text file in a
706 dialog box. It is like a simple text file viewer. The user can
707 move through the file by using the cursor, page-up, page-down
708 and HOME/END keys available on most keyboards. If the lines are
709 too long to be displayed in the box, the LEFT/RIGHT keys can be
710 used to scroll the text region horizontally. You may also use
711 vi-style keys h, j, k, l in place of the cursor keys, and B or N
712 in place of the page-up and page-down keys. Scroll up/down
713 using vi-style 'k' and 'j', or arrow-keys. Scroll left/right
714 using vi-style 'h' and 'l', or arrow-keys. A '0' resets the
715 left/right scrolling. For more convenience, vi-style forward
716 and backward searching functions are also provided.
717
718 On exit, no text is written to dialog's output. Only an "EXIT"
719 button is provided for input, but an ESC exit status may be
720 returned.
721
722 --timebox text height [width hour minute second]
723 A dialog is displayed which allows you to select hour, minute
724 and second. If the values for hour, minute or second are miss‐
725 ing or negative, the current date's corresponding values are
726 used. You can increment or decrement any of those using the
727 left-, up-, right- and down-arrows. Use tab or backtab to move
728 between windows.
729
730 On exit, the result is printed in the form hour:minute:second.
731
732 --yesno text height width
733 A yes/no dialog box of size height rows by width columns will be
734 displayed. The string specified by text is displayed inside the
735 dialog box. If this string is too long to fit in one line, it
736 will be automatically divided into multiple lines at appropriate
737 places. The text string can also contain the sub-string "\n" or
738 newline characters `\n' to control line breaking explicitly.
739 This dialog box is useful for asking questions that require the
740 user to answer either yes or no. The dialog box has a Yes but‐
741 ton and a No button, in which the user can switch between by
742 pressing the TAB key.
743
744 On exit, no text is written to dialog's output. In addition to
745 the "Yes" and "No" exit codes (see DIAGNOSTICS) an ESC exit sta‐
746 tus may be returned.
747
748 The codes used for "Yes" and "No" match those used for "OK" and
749 "Cancel", internally no distinction is made.
750
751 Obsolete Options
752 --beep This was used to tell the original cdialog that it should make a
753 beep when the separate processes of the tailboxbg widget would
754 repaint the screen.
755
756 --beep-after
757 Beep after a user has completed a widget by pressing one of the
758 buttons.
759
761 1. Create a sample configuration file by typing:
762
763 "dialog --create-rc <file>"
764
765 2. At start, dialog determines the settings to use as follows:
766
767 a) if environment variable DIALOGRC is set, its value determines
768 the name of the configuration file.
769
770 b) if the file in (a) is not found, use the file $HOME/.dialogrc
771 as the configuration file.
772
773 c) if the file in (b) is not found, try using the GLOBALRC file
774 determined at compile-time, i.e., /etc/dialogrc.
775
776 d) if the file in (c) is not found, use compiled in defaults.
777
778 3. Edit the sample configuration file and copy it to some place that
779 dialog can find, as stated in step 2 above.
780
782 You can override or add to key bindings in dialog by adding to the con‐
783 figuration file. Dialog's bindkey command maps single keys to its
784 internal coding.
785 bindkey widget curses_key dialog_key
786 The widget name can be "*" (all widgets), or specific widgets such as
787 textbox. Specific widget bindings override the "*" bindings. User-
788 defined bindings override the built-in bindings.
789
790 The curses_key can be any of the names derived from curses.h, e.g.,
791 "HELP" from "KEY_HELP". Dialog also recognizes ANSI control characters
792 such as "^A", "^?", as well as C1-controls such as "~A" and "~?".
793 Finally, it allows any single character to be escaped with a backslash.
794
795 Dialog's internal keycode names correspond to the DLG_KEYS_ENUM type in
796 dlg_keys.h, e.g., "HELP" from "DLGK_HELP".
797
799 DIALOGOPTS Define this variable to apply any of the common options
800 to each widget. Most of the common options are reset
801 before processing each widget. If you set the options
802 in this environment variable, they are applied to dia‐
803 log's state after the reset. As in the "--file" option,
804 double-quotes and backslashes are interpreted.
805
806 The "--file" option is not considered a common option
807 (so you cannot embed it within this environment vari‐
808 able).
809
810 DIALOGRC Define this variable if you want to specify the name of
811 the configuration file to use.
812
813 DIALOG_CANCEL
814
815 DIALOG_ERROR
816
817 DIALOG_ESC
818
819 DIALOG_EXTRA
820
821 DIALOG_HELP
822
823 DIALOG_ITEM_HELP
824
825 DIALOG_OK Define any of these variables to change the exit code on
826 Cancel (1), error (-1), ESC (255), Extra (3), Help (2),
827 Help with --item-help (2), or OK (0). Normally shell
828 scripts cannot distinguish between -1 and 255.
829
830 DIALOG_TTY Set this variable to "1" to provide compatibility with
831 older versions of dialog which assumed that if the
832 script redirects the standard output, that the "--std‐
833 out" option was given.
834
836 $HOME/.dialogrc default configuration file
837
839 The dialog sources contain several samples of how to use the different
840 box options and how they look. Just take a look into the directory
841 samples/ of the source.
842
844 Exit status is subject to being overridden by environment variables.
845 Normally they are:
846
847 0 if dialog is exited by pressing the Yes or OK button.
848
849 1 if the No or Cancel button is pressed.
850
851 2 if the Help button is pressed.
852
853 3 if the Extra button is pressed.
854
855 -1 if errors occur inside dialog or dialog is exited by pressing the
856 ESC key.
857
859 You may want to write scripts which run with other dialog "clones".
860
861 ORIGINAL DIALOG
862 First, there is the "original" dialog program to consider (versions 0.3
863 to 0.9). It had some misspelled (or inconsistent) options. The dialog
864 program maps those deprecated options to the preferred ones. They
865 include:
866
867 Option Treatment
868 ─────────────────────────────────
869 --beep-after ignored
870 --guage mapped to --gauge
871
872 XDIALOG
873 Technically, "Xdialog", this is an X application. With some care, it
874 is possible to write useful scripts that work with both Xdialog and
875 dialog.
876
877 The dialog program ignores these options which are recognized by Xdia‐
878 log:
879
880 Option Treatment
881 ───────────────────────────────────────────────
882 --allow-close ignored
883 --auto-placement ignored
884 --fixed-font ignored
885 --icon ignored
886 --keep-colors ignored
887 --no-close ignored
888 --no-cr-wrap ignored
889 --screen-center ignored
890 --separator mapped to --separate-output
891 --smooth ignored
892 --under-mouse ignored
893 --wmclass ignored
894
895 Xdialog's manpage has a section discussing its compatibility with dia‐
896 log.
897
898 WHIPTAIL
899 Then there is whiptail. For practical purposes, it is maintained by
900 Debian. Its documentation claims
901
902 whiptail(1) is a lightweight replacement for dialog(1),
903 to provide dialog boxes for shell scripts. It is built on the
904 newt windowing library rather than the ncurses library, allowing
905 it to be smaller in embedded enviroments such as installers,
906 rescue disks, etc.
907
908 whiptail is designed to be drop-in compatible with dialog, but
909 has less features: some dialog boxes are not implemented, such
910 as tailbox, timebox, calendarbox, etc.
911
912 Comparing actual sizes (Debian testing, 2007/1/10): The total of sizes
913 for whiptail, the newt, popt and slang libraries is 757kb. The compa‐
914 rable number for dialog (counting ncurses) is 520kb. Disregard the
915 first paragraph.
916
917 The second paragraph is misleading, since whiptail also does not work
918 for common options of dialog, such as the gauge box. whiptail is less
919 compatible with dialog than the decade-old original dialog 0.4 program.
920
921 whiptail's manpage borrows features from dialog, e.g., --default-item,
922 --output-fd, but oddly cites only dialog versions up to 0.4 as a
923 source. That is, its manpage refers to features which were borrowed
924 from more recent versions of dialog, e.g., the --gauge and --password
925 boxes, as well as options such as -separate-output. Somewhat humor‐
926 ously, one may note that the popt feature (undocumented in its manpage)
927 of using a "--" as an escape was documented in dialog's manpage about a
928 year before it was mentioned in whiptail's manpage. whiptail's manpage
929 incorrectly attributes that to getopt (and is inaccurate anyway).
930
931 Debian uses whiptail for the official dialog variation.
932
933 The dialog program ignores or maps these options which are recognized
934 by whiptail:
935
936 Option Treatment
937 ─────────────────────────────────────
938 --fb ignored
939 --fullbutton ignored
940 --nocancel mapped to --no-cancel
941 --noitem ignored
942
944 Perhaps.
945
947 Thomas E. Dickey (updates for 0.9b and beyond)
948
950 Kiran Cherupally - the mixed form and mixed gauge widgets.
951
952 Tobias C. Rittweiler
953
954 Valery Reznic - the form and progressbox widgets.
955
956 Yura Kalinichenko adapted the gauge widget as "pause".
957
958 This is a rewrite (except as needed to provide compatibility) of the
959 earlier version of dialog 0.9a, which lists as authors:
960
961 Savio Lam - version 0.3, "dialog"
962
963 Stuart Herbert - patch for version 0.4
964
965 Marc Ewing - the gauge widget.
966
967 Pasquale De Marco "Pako" - version 0.9a, "cdialog"
968
969
970
971$Date: 2008/07/27 22:49:40 $ DIALOG(1)