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