initial packaging
[platform/upstream/dialog.git] / dialog.1
1 '\" t
2 .\" $Id: dialog.1,v 1.184 2014/02/20 00:32:58 tom Exp $
3 .\" Copyright 2005-2013,2014  Thomas E. Dickey
4 .\"
5 .\" This program is free software; you can redistribute it and/or modify
6 .\" it under the terms of the GNU Lesser General Public License, version 2.1
7 .\" as published by the Free Software Foundation.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" Lesser General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU Lesser General Public
15 .\" License along with this program; if not, write to
16 .\"     Free Software Foundation, Inc.
17 .\"     51 Franklin St., Fifth Floor
18 .\"     Boston, MA 02110, USA.
19 .\"
20 .\" definitions for renaming
21 .ds p dialog
22 .ds l dialog
23 .ds L Dialog
24 .ds D DIALOG
25 .\"
26 .de ES
27 .ne 8
28 .IP
29 ..
30 .de Ex
31 .RS +7
32 .PP
33 .nf
34 .ft CW
35 ..
36 .de Ee
37 .fi
38 .ft R
39 .RE
40 ..
41 .\" Bulleted paragraph
42 .de bP
43 .IP \(bu 4
44 ..
45 .
46 .TH \*D 1 "" "$Date: 2014/02/20 00:32:58 $"
47 .SH NAME
48 dialog \- display dialog boxes from shell scripts
49 .SH SYNOPSIS
50 \fB\*p --clear\fP
51 .br
52 .BI "\*p --create-rc " file
53 .br
54 \fB\*p --print-maxsize\fP
55 .br
56 \fB\*p\fP
57 \fIcommon-options\fP
58 \fIbox-options\fP
59 .SH DESCRIPTION
60 \fB\*L\fP
61 is a program that will let you present a variety of questions or
62 display messages using dialog boxes from a shell script.
63 These types of dialog boxes are implemented
64 (though not all are necessarily compiled into \fB\*p\fR):
65 .RS
66 .LP
67 .nh
68 .na
69 .BR buildlist ", "
70 .BR calendar ", "
71 .BR checklist ", "
72 .BR dselect ", "
73 .BR editbox ", "
74 .BR form ", "
75 .BR fselect ", "
76 .BR gauge ", "
77 .BR infobox ", "
78 .BR inputbox ", "
79 .BR inputmenu ", "
80 .BR menu ", "
81 .BR mixedform ", "
82 .BR mixedgauge ", "
83 .BR msgbox " (message), "
84 .BR passwordbox ", "
85 .BR passwordform ", "
86 .BR pause ", "
87 .BR prgbox ", "
88 .BR programbox ", "
89 .BR progressbox ", "
90 .BR radiolist ", "
91 .BR rangebox ", "
92 .BR tailbox ", "
93 .BR tailboxbg ", "
94 .BR textbox ", "
95 .BR timebox ", "
96 .BR treeview ", and "
97 .BR yesno " (yes/no)."
98 .ad
99 .hy
100 .RE
101 .PP
102 You can put more than one dialog box into a script:
103 .bP
104 Use the "\fB--and-widget\fP" token to force \fB\*p\fP to proceed to the next
105 dialog unless you have pressed ESC to cancel, or
106 .bP
107 Simply add the tokens for the next dialog box, making a chain.
108 \*L stops chaining when the return code from a dialog is nonzero,
109 e.g., Cancel or No (see DIAGNOSTICS).
110 .PP
111 Some widgets, e.g., checklist, will write text to \fB\*p\fP's output.
112 Normally that is the standard error, but there are options for
113 changing this: "\fB--output-fd\fP", "\fB--stderr\fP" and "\fB--stdout\fP".
114 No text is written if the Cancel button (or ESC) is pressed;
115 \fB\*p\fP exits immediately in that case.
116 .
117 .\" ************************************************************************
118 .SH OPTIONS
119 All options begin with "\fB--\fP"
120 (two ASCII hyphens,
121 for the benefit of those using systems with deranged locale support).
122 .PP
123 A "\fB--\fP" by itself is used as an escape,
124 i.e., the next token on the command-line is not treated as an option.
125 .RS
126 .B \*p --title -- --Not an option
127 .RE
128 .PP
129 The "\fB--args\fP" option tells \fB\*p\fP to list the command-line
130 parameters to the standard error.
131 This is useful when debugging complex scripts using
132 the "\fB--\fP" and "\fB--file\fP",
133 since the command-line may be rewritten as these are expanded.
134 .PP
135 The "\fB--file\fP" option tells \fB\*p\fP to read parameters from
136 the file named as its value.
137 .RS
138 .B \*p --file \fIparameterfile
139 .RE
140 Blanks not within double-quotes are discarded
141 (use backslashes to quote single characters).
142 The result is inserted into the command-line,
143 replacing "\fB--file\fP" and its option value.
144 Interpretation of the command-line resumes from that point.
145 If \fIparameterfile\fP begins with "&", \fB\*p\fP
146 interprets the following text as a file descriptor number
147 rather than a filename.
148 .
149 .SS \fBCommon Options\fP
150 .
151 .IP "\fB--ascii-lines
152 Rather than draw graphics lines around boxes,
153 draw ASCII "+" and "-" in the same place.
154 See also "\fB--no-lines\fR".
155 .
156 .IP "\fB--aspect \fIratio"
157 This gives you some control over the box dimensions when using auto
158 sizing (specifying 0 for height and width).
159 It represents width / height.
160 The default is 9, which means 9 characters wide to every 1 line high.
161 .
162 .IP "\fB--backtitle \fIbacktitle"
163 Specifies a
164 \fIbacktitle\fP
165 string to be displayed on the backdrop, at the top of the screen.
166 .
167 .IP "\fB--begin \fIy x"
168 Specify the position of the upper left corner of a dialog box on the screen.
169 .
170 .IP "\fB--cancel-label \fIstring"
171 Override the label used for "Cancel" buttons.
172 .
173 .IP "\fB--clear"
174 Clears the widget screen, keeping only the screen_color background.
175 Use this when you combine widgets with "\fB--and-widget\fR" to erase the
176 contents of a previous widget on the screen, so it won't be seen
177 under the contents of a following widget.
178 Understand this as the complement of "\fB--keep-window\fR".
179 To compare the effects, use these:
180 .
181 .ES
182 All three widgets visible, staircase effect, ordered 1,2,3:
183 .Ex
184 \*p \e
185                                --begin 2 2 --yesno "" 0 0 \e
186     --and-widget               --begin 4 4 --yesno "" 0 0 \e
187     --and-widget               --begin 6 6 --yesno "" 0 0
188 .Ee
189 .
190 .ES
191 Only the last widget is left visible:
192 .Ex
193 \*p \e
194                  --clear       --begin 2 2 --yesno "" 0 0 \e
195     --and-widget --clear       --begin 4 4 --yesno "" 0 0 \e
196     --and-widget               --begin 6 6 --yesno "" 0 0
197 .Ee
198 .
199 .ES
200 All three widgets visible, staircase effect, ordered 3,2,1:
201 .Ex
202 \*p \e
203                  --keep-window --begin 2 2 --yesno "" 0 0 \e
204     --and-widget --keep-window --begin 4 4 --yesno "" 0 0 \e
205     --and-widget               --begin 6 6 --yesno "" 0 0
206 .Ee
207 .
208 .ES
209 First and third widget visible, staircase effect, ordered 3,1:
210 .Ex
211 \*p \e
212                  --keep-window --begin 2 2 --yesno "" 0 0 \e
213     --and-widget --clear       --begin 4 4 --yesno "" 0 0 \e
214     --and-widget               --begin 6 6 --yesno "" 0 0
215 .Ee
216 .IP
217 Note, if you want to restore original console colors and send your
218 cursor home after the dialog program has exited, use the \fBclear\fR\ (1)
219 command.
220 .
221 .IP "\fB--colors"
222 Interpret embedded "\eZ" sequences in the dialog text
223 by the following character,
224 which tells \fB\*p\fP to set colors or video attributes:
225 .RS
226 .bP
227 0 through 7 are the ANSI color numbers used in curses:
228 black,
229 red,
230 green,
231 yellow,
232 blue,
233 magenta,
234 cyan and
235 white respectively.
236 .bP
237 Bold is set by 'b', reset by 'B'.
238 .bP
239 Reverse is set by 'r', reset by 'R'.
240 .bP
241 Underline is set by 'u', reset by 'U'.
242 .bP
243 The settings are cumulative, e.g., "\eZb\eZ1" makes the following text
244 bold (perhaps bright) red.
245 .bP
246 Restore normal settings with "\eZn".
247 .RE
248 .
249 .IP "\fB--column-separator \fIstring"
250 Tell \fB\*p\fP to split data for radio/checkboxes and menus on the
251 occurrences of the given string, and to align the split data into columns.
252 .
253 .IP "\fB--cr-wrap"
254 Interpret embedded newlines in the dialog text as a newline on the screen.
255 Otherwise, \fB\*p\fR will only wrap lines where needed to fit inside the text box.
256 .IP
257 Even though you can control line breaks with this,
258 \fB\*L\fR will still wrap any lines that are too long for the width of the box.
259 Without cr-wrap, the layout of your text may be formatted to look nice
260 in the source code of your script without affecting the way it will
261 look in the dialog.
262 .IP
263 See also the "\fB--no-collapse\fP" and "\fB--trim\fP" options.
264 .
265 .IP "\fB--create-rc \fIfile"
266 When
267 \fB\*p\fP
268 supports run-time configuration,
269 this can be used to dump a sample configuration file to the file specified
270 by
271 .IR file "."
272 .
273 .IP "\fB--date-format \fIformat"
274 If the host provides \fBstrftime\fP,
275 this option allows you to specify the format of the date printed for
276 the \fB--calendar\fP widget.
277 The time of day (hour, minute, second) are the current local time.
278 .
279 .IP "\fB--defaultno"
280 Make the default value of the
281 \fByes/no\fP
282 box a
283 .BR No .
284 Likewise, make the default button of widgets that provide "OK" and "Cancel"
285 a \fBCancel\fP.
286 If "\fB--nocancel\fP" or "\fB--visit-items\fP" are given
287 those options overrides this,
288 making the default button always "Yes" (internally the same as "OK").
289 .
290 .IP "\fB--default-button \fIstring"
291 Set the default (preselected) button in a widget.
292 By preselecting a button,
293 a script makes it possible for the user to simply press \fIEnter\fP
294 to proceed through a dialog with minimum interaction.
295 .IP
296 The option's value is the name of the button:
297 .IR ok ,
298 .IR yes ,
299 .IR cancel ,
300 .IR no ,
301 .IR help "\ or"
302 .IR extra .
303 .IP
304 Normally the first button in each widget is the default.
305 The first button shown is determined by the widget
306 together with the "\fB--nook\fP" and "\fB--nocancel\fP options.
307 If this option is not given, there is no default button assigned.
308 .
309 .IP "\fB--default-item \fIstring"
310 Set the default item in a checklist, form or menu box.
311 Normally the first item in the box is the default.
312 .
313 .IP "\fB--exit-label \fIstring"
314 Override the label used for "EXIT" buttons.
315 .
316 .IP "\fB--extra-button"
317 Show an extra button, between "OK" and "Cancel" buttons.
318 .
319 .IP "\fB--extra-label \fIstring"
320 Override the label used for "Extra" buttons.
321 Note: for inputmenu widgets, this defaults to "Rename".
322 .
323 .IP "\fB--help"
324 Prints the help message to the standard output and exits.
325 The help message is also printed if no options are given,
326 or if an unrecognized option is given.
327 .
328 .IP "\fB--help-button"
329 Show a help-button after "OK" and "Cancel" buttons,
330 i.e., in checklist, radiolist and menu boxes.
331 .IP
332 On exit, the return status will indicate that the Help button was pressed.
333 \fB\*L\fP will also write a message to its output after the token "HELP":
334 .RS
335 .bP
336 If "\fB--item-help\fR" is also given, the item-help text will be written.
337 .bP
338 Otherwise, the item's tag (the first field) will be written.
339 .RE
340 .IP
341 .IP
342 You can use the \fB--help-tags\fP option and/or set the DIALOG_ITEM_HELP
343 environment variable to modify these messages and exit-status.
344 .
345 .IP "\fB--help-label \fIstring"
346 Override the label used for "Help" buttons.
347 .
348 .IP "\fB--help-status"
349 If the help-button is selected,
350 writes the checklist, radiolist or form information
351 after the item-help "HELP" information.
352 This can be used to reconstruct the state of a checklist after processing
353 the help request.
354 .
355 .IP "\fB--help-tags"
356 Modify the messages written on exit for \fB--help-button\fP
357 by making them always just the item's tag.
358 This does not affect the exit status code.
359 .
360 .IP "\fB--hfile \fIfilename"
361 Display the given file using a textbox when the user presses F1.
362 .
363 .IP "\fB--hline \fIstring"
364 Display the given string centered at the bottom of the widget.
365 .
366 .IP "\fB--ignore"
367 Ignore options that \fB\*p\fP does not recognize.
368 Some well-known ones such as "\fB--icon\fP" are ignored anyway,
369 but this is a better choice for compatibility with other implementations.
370 .
371 .IP "\fB--input-fd \fIfd"
372 Read keyboard input from the given file descriptor.
373 Most \fB\*p\fR scripts read from the standard input,
374 but the gauge widget reads a pipe (which is always standard input).
375 Some configurations do not work properly when
376 \fB\*p\fP tries to reopen the terminal.
377 Use this option (with appropriate juggling of file-descriptors)
378 if your script must work in that type of environment.
379 .
380 .IP "\fB--insecure"
381 Makes the password widget friendlier but less secure,
382 by echoing asterisks for each character.
383 .
384 .IP "\fB--item-help"
385 Interpret the tags data for checklist, radiolist and menu boxes
386 adding a column which is displayed in the bottom line of the
387 screen, for the currently selected item.
388 .
389 .IP "\fB--keep-tite"
390 When built with \fBncurses\fP,
391 \fB\*p\fP normally checks to see if it is running in an \fBxterm\fP,
392 and in that case tries to suppress the initialization strings that
393 would make it switch to the alternate screen.
394 Switching between the normal and alternate screens
395 is visually distracting in a script which runs \fB\*p\fP
396 several times.
397 Use this option to allow \fB\*p\fP to use those initialization strings.
398 .
399 .IP "\fB--keep-window"
400 Normally when \fB\*p\fR performs several \fBtailboxbg\fR widgets
401 connected by "\fB--and-widget\fR",
402 it clears the old widget from the screen by painting over it.
403 Use this option to suppress that repainting.
404 .IP
405 At exit, \fB\*p\fR repaints all of the widgets which have been
406 marked with "\fB--keep-window\fR", even if they are not \fBtailboxbg\fR widgets.
407 That causes them to be repainted in reverse order.
408 See the discussion of the "\fB--clear\fR" option for examples.
409 .
410 .IP "\fB--last-key"
411 At exit, report the last key which the user entered.
412 This is the curses key code rather than a symbol or literal character.
413 It can be used by scripts to distinguish between two keys which are
414 bound to the same action.
415 .
416 .IP "\fB--max-input \fIsize"
417 Limit input strings to the given size.
418 If not specified, the limit is 2048.
419 .
420 .IP "\fB--no-cancel"
421 .IP "\fB--nocancel"
422 Suppress the "Cancel" button in checklist, inputbox and menu box modes.
423 A script can still test if the user pressed the ESC key to cancel to quit.
424 .
425 .IP "\fB--no-collapse"
426 Normally \fB\*p\fR converts tabs to spaces and reduces multiple
427 spaces to a single space for text which is displayed in a message boxes, etc.
428 Use this option to disable that feature.
429 Note that \fB\*p\fR will still wrap text,
430 subject to the "\fB--cr-wrap\fR" and "\fB--trim\fR" options.
431 .
432 .IP "\fB--no-items"
433 Some widgets (checklist, inputmenu, radiolist, menu) display a list
434 with two columns (a "tag" and "item", i.e., "description").
435 This option tells \fB\*p\fP to read shorter rows,
436 omitting the "item" part of the list.
437 This is occasionally useful, e.g., if the tags provide enough information.
438 .IP
439 See also \fB--no-tags\fP.
440 If both options are given, this one is ignored.
441 .
442 .IP "\fB--no-kill"
443 Tells
444 \fB\*p\fP
445 to put the
446 \fBtailboxbg\fP
447 box in the background,
448 printing its process id to \fB\*p\fP's output.
449 SIGHUP is disabled for the background process.
450 .
451 .IP "\fB--no-label \fIstring"
452 Override the label used for "No" buttons.
453 .
454 .IP "\fB--no-lines
455 Rather than draw lines around boxes, draw spaces in the same place.
456 See also "\fB--ascii-lines\fR".
457 .
458 .IP "\fB--no-mouse
459 Do not enable the mouse.
460 .
461 .IP "\fB--no-nl-expand
462 Do not convert "\en" substrings of the message/prompt text into
463 literal newlines.
464 .
465 .IP "\fB--no-ok"
466 .IP "\fB--nook"
467 Suppress the "OK" button in checklist, inputbox and menu box modes.
468 A script can still test if the user pressed the "Enter" key to accept the data.
469 .
470 .IP "\fB--no-shadow"
471 Suppress shadows that would be drawn to the right and bottom of each dialog box.
472 .
473 .IP "\fB--no-tags"
474 Some widgets (checklist, inputmenu, radiolist, menu) display a list
475 with two columns (a "tag" and "description").
476 The tag is useful for scripting, but may not help the user.
477 The \fB--no-tags\fP option (from Xdialog) may be used to suppress the
478 column of tags from the display.
479 Unlike the \fB--no-items\fP option,
480 this does not affect the data which is read from the script.
481 .IP
482 Xdialog does not display the tag column for the analogous buildlist
483 and treeview widgets; \fB\*p\fP does the same.
484 .IP
485 Normally \fB\*p\fP allows you to quickly move to entries on the displayed list,
486 by matching a single character to the first character of the tag.
487 When the \fB--no-tags\fP option is given, \fB\*p\fP matches against
488 the first character of the description.
489 In either case, the matchable character is highlighted.
490 .
491 .IP "\fB--ok-label \fIstring"
492 Override the label used for "OK" buttons.
493 .
494 .IP "\fB--output-fd \fIfd"
495 Direct output to the given file descriptor.
496 Most \fB\*p\fR scripts write to the standard error,
497 but error messages may also be written there, depending on your script.
498 .
499 .IP "\fB--separator \fIstring"
500 .IP "\fB--output-separator\fIstring"
501 Specify a string that will separate the output on \fB\*p\fP's output from
502 checklists, rather than a newline (for \fB--separate-output\fP) or a space.
503 This applies to other widgets such as forms and editboxes which normally
504 use a newline.
505 .
506 .IP "\fB--print-maxsize"
507 Print the maximum size of dialog boxes, i.e., the screen size,
508 to \fB\*p\fP's output.
509 This may be used alone, without other options.
510 .
511 .IP "\fB--print-size"
512 Prints the size of each dialog box to \fB\*p\fP's output.
513 .
514 .IP "\fB--print-version"
515 Prints \fB\*p\fR's version to \fB\*p\fP's output.
516 This may be used alone, without other options.
517 It does not cause \fBdialog\fP to exit by itself.
518 .
519 .IP "\fB--quoted"
520 Normally \fB\*p\fP quotes the strings returned by checklist's
521 as well as the item-help text.
522 Use this option to quote all string results.
523 .
524 .IP "\fB--scrollbar"
525 For widgets holding a scrollable set of data,
526 draw a scrollbar on its right-margin.
527 This does not respond to the mouse.
528 .
529 .IP "\fB--separate-output"
530 For certain widgets (buildlist, checklist, treeview),
531 output result one line at a time, with no quoting.
532 This facilitates parsing by another program.
533 .
534 .IP "\fB--separate-widget \fIstring"
535 Specify a string that will separate the output on \fB\*p\fP's output from
536 each widget.
537 This is used to simplify parsing the result of a dialog with several widgets.
538 If this option is not given,
539 the default separator string is a tab character.
540 .
541 .IP "\fB--shadow"
542 Draw a shadow to the right and bottom of each dialog box.
543 .
544 .IP "\fB--single-quoted"
545 Use single-quoting as needed (and no quotes if unneeded) for the
546 output of checklist's as well as the item-help text.
547 If this option is not set, \fB\*p\fP uses double quotes around each item.
548 In either case,
549 \fB\*p\fP adds backslashes to make the output useful in shell scripts.
550 .
551 .IP "\fB--size-err"
552 Check the resulting size of a dialog box before trying to use it,
553 printing the resulting size if it is larger than the screen.
554 (This option is obsolete, since all new-window calls are checked).
555 .
556 .IP "\fB--sleep \fIsecs"
557 Sleep (delay) for the given number of seconds after processing a dialog box.
558 .
559 .IP "\fB--stderr"
560 Direct output to the standard error.
561 This is the default, since curses normally writes screen updates to
562 the standard output.
563 .
564 .IP "\fB--stdout"
565 Direct output to the standard output.
566 This option is provided for compatibility with Xdialog,
567 however using it in portable scripts is not recommended,
568 since curses normally writes its screen updates to the standard output.
569 If you use this option, \fB\*p\fR attempts to reopen the terminal
570 so it can write to the display.
571 Depending on the platform and your environment, that may fail.
572 .
573 .IP "\fB--tab-correct"
574 Convert each tab character to one or more spaces
575 (for the \fBtextbox\fP widget; otherwise to a single space).
576 Otherwise, tabs are rendered according to the curses library's interpretation.
577 .
578 .IP "\fB--tab-len \fIn"
579 Specify the number of spaces that a tab character occupies if the
580 "\fB--tab-correct\fP" option is given.
581 The default is 8.
582 This option is only effective for the \fBtextbox\fP widget.
583 .
584 .IP "\fB--time-format \fIformat"
585 If the host provides \fBstrftime\fP,
586 this option allows you to specify the format of the time printed for
587 the \fB--timebox\fP widget.
588 The day, month, year values in this case are for the current local time.
589 .
590 .IP "\fB--timeout \fIsecs"
591 Timeout (exit with error code)
592 if no user response within the given number of seconds.
593 A timeout of zero seconds is ignored.
594 .IP
595 This option is ignored by the "\fB--pause\fP" widget.
596 It is also overridden if the background "\fB--tailboxbg\fP" option is used
597 to setup multiple concurrent widgets.
598 .
599 .IP "\fB--title \fItitle"
600 Specifies a
601 \fItitle\fP
602 string to be displayed at the top of the dialog box.
603 .
604 .IP "\fB--trace \fIfilename"
605 logs the command-line parameters,
606 keystrokes and other information to the given file.
607 If \fBdialog\fP reads a configure file, it is logged as well.
608 Piped input to the \fIgauge\fP widget is logged.
609 Use control/T to log a picture of the current dialog window.
610 .PP
611 The \fB\*p\fR program handles some command-line parameters specially,
612 and removes them from the parameter list as they are processed.
613 For example, if the first option is \fB--trace\fP,
614 then that is processed (and removed) before \fB\*p\fR initializes the display.
615 .
616 .IP "\fB--trim"
617 eliminate leading blanks,
618 trim literal newlines and repeated blanks from message text.
619 .
620 .IP
621 See also the "\fB--cr-wrap\fR" and "\fB--no-collapse\fR" options.
622 .
623 .IP "\fB--version"
624 Prints \fB\*p\fR's version to the standard output, and exits.
625 See also "\fB--print-version\fP".
626 .
627 .IP "\fB--visit-items"
628 Modify the tab-traversal of checklist, radiolist, menubox and inputmenu
629 to include the list of items as one of the states.
630 This is useful as a visual aid,
631 i.e., the cursor position helps some users.
632 .IP
633 When this option is given, the cursor is initially placed on the list.
634 Abbreviations (the first letter of the tag) apply to the list items.
635 If you tab to the button row, abbreviations apply to the buttons.
636 .
637 .IP "\fB--yes-label \fIstring"
638 Override the label used for "Yes" buttons.
639 .
640 .\" ************************************************************************
641 .SS Box Options
642 All dialog boxes have at least three parameters:
643 .TP 7
644 \fItext\fP
645 the caption or contents of the box.
646 .TP 7
647 \fIheight\fP
648 the height of the dialog box.
649 .TP 7
650 \fIwidth\fP
651 the width of the dialog box.
652 .PP
653 Other parameters depend on the box type.
654 .
655 .
656 .IP "\fB--buildlist \fItext height width list-height \fR[ \fItag item status \fR] \fI..."
657 A \fBbuildlist\fP dialog displays two lists, side-by-side.
658 The list on the left shows unselected items.
659 The list on the right shows selected items.
660 As items are selected or unselected, they move between the lists.
661 .IP
662 Use a carriage return or the "OK" button to accept the current value
663 in the selected-window and exit.
664 The results are written using the order displayed in the selected-window.
665 .IP
666 The initial on/off state of each entry is specified by
667 .IR status "."
668 .IP
669 The dialog behaves like a \fBmenu\fP, using the \fB--visit-items\fP
670 to control whether the cursor is allowed to visit the lists directly.
671 .RS
672 .bP
673 If \fB--visit-items\fP is not given,
674 tab-traversal uses two states (OK/Cancel).
675 .bP
676 If \fB--visit-items\fP is given,
677 tab-traversal uses four states (Left/Right/OK/Cancel).
678 .RE
679 .IP
680 Whether or not \fB--visit-items\fP is given,
681 it is possible to move the highlight between the two lists using
682 the default "^" (left-column) and "$" (right-column) keys.
683 .IP
684 On exit, a list of the \fItag\fP
685 strings of those entries that are turned on
686 will be printed on \fB\*p\fP's output.
687 .IP
688 If the "\fB--separate-output\fP" option is not given,
689 the strings will be quoted as needed to make it simple for scripts to separate them.
690 By default, this uses double-quotes.
691 See the "\fB--single-quoted\fP" option, which modifies the quoting behavior.
692 .
693 .
694 .IP "\fB--calendar \fItext height width day month year"
695 A \fBcalendar\fP box displays
696 month, day and year in separately adjustable windows.
697 If the values for day, month or year are missing or negative,
698 the current date's corresponding values are used.
699 You can increment or decrement any of those using the
700 left-, up-, right-, and down-arrows.
701 Use vi-style h, j, k and l for moving around the array of days in a month.
702 Use tab or backtab to move between windows.
703 If the year is given as zero, the current date is used as an initial value.
704 .IP
705 On exit, the date is printed in the form day/month/year.
706 The format can be overridden using the \fB--date-format\fP option.
707 .
708 .
709 .IP "\fB--checklist \fItext height width list-height \fR[ \fItag item status \fR] \fI..."
710 A
711 \fBchecklist\fP
712 box is similar to a
713 \fBmenu\fP
714 box; there are
715 multiple entries presented in the form of a menu.
716 Another difference is
717 that you can indicate which entry is currently selected, by setting its
718 .IR status " to " on "."
719 Instead of choosing
720 one entry among the entries, each entry can be turned on or off by the user.
721 The initial on/off state of each entry is specified by
722 .IR status "."
723 .IP
724 On exit, a list of the \fItag\fP
725 strings of those entries that are turned on
726 will be printed on \fB\*p\fP's output.
727 .IP
728 If the "\fB--separate-output\fP" option is not given,
729 the strings will be quoted as needed to make it simple for scripts to separate them.
730 By default, this uses double-quotes.
731 See the "\fB--single-quoted\fP" option, which modifies the quoting behavior.
732 .
733 .
734 .IP "\fB--dselect \fIfilepath height width\fR"
735 The directory-selection dialog displays a text-entry window in which you can type
736 a directory, and above that a windows with directory names.
737 .IP
738 Here
739 \fBfilepath\fP
740 can be a filepath in which case the directory window
741 will display the contents of the path and the text-entry window will contain
742 the preselected directory.
743 .IP
744 Use tab or arrow keys to move between the windows.
745 Within the directory window, use the up/down arrow keys
746 to scroll the current selection.
747 Use the space-bar to copy the current selection into the text-entry
748 window.
749 .IP
750 Typing any printable characters switches focus to the text-entry window,
751 entering that character as well as scrolling the directory
752 window to the closest match.
753 .IP
754 Use a carriage return or the "OK" button to accept the current value
755 in the text-entry window and exit.
756 .IP
757 On exit, the contents of the text-entry window are written to \fB\*p\fP's output.
758 .
759 .IP "\fB--editbox \fIfilepath height width\fR"
760 The edit-box dialog displays a copy of the file.
761 You may edit it using
762 the \fIbackspace\fP, \fIdelete\fP and cursor keys
763 to correct typing errors.
764 It also recognizes pageup/pagedown.
765 Unlike the \fB--inputbox\fP,
766 you must tab to the "OK" or "Cancel" buttons to close the dialog.
767 Pressing the "Enter" key within the box will split the corresponding line.
768 .IP
769 On exit, the contents of the edit window are written to \fB\*p\fP's output.
770 .
771 .nf
772 .IP "\fB--form \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
773 .fi
774 The \fBform\fP dialog displays a form consisting of labels and fields,
775 which are positioned on a scrollable window by coordinates given in the script.
776 The field length \fIflen\fR and input-length \fIilen\fR tell how long
777 the field can be.
778 The former defines the length shown for a selected field,
779 while the latter defines the permissible length of the data entered in the
780 field.
781 .RS
782 .bP
783 If \fIflen\fR is zero, the corresponding field cannot be altered.
784 and the contents of the field determine the displayed-length.
785 .bP
786 If \fIflen\fR is negative, the corresponding field cannot be altered,
787 and the negated value of \fIflen\fR is used as the displayed-length.
788 .bP
789 If \fIilen\fR is zero, it is set to \fIflen\fR.
790 .RE
791 .IP
792 Use up/down arrows (or control/N, control/P) to move between fields.
793 Use tab to move between windows.
794 .IP
795 On exit, the contents of the form-fields are written to \fB\*p\fP's output,
796 each field separated by a newline.
797 The text used to fill non-editable fields
798 (\fIflen\fR is zero or negative)
799 is not written out.
800 .
801 .
802 .IP "\fB--fselect \fIfilepath height width\fR"
803 The \fBfselect\fP (file-selection) dialog displays a text-entry window in which you can type
804 a filename (or directory), and above that two windows with directory
805 names and filenames.
806 .IP
807 Here
808 \fBfilepath\fP
809 can be a filepath in which case the file and directory windows
810 will display the contents of the path and the text-entry window will contain
811 the preselected filename.
812 .IP
813 Use tab or arrow keys to move between the windows.
814 Within the directory or filename windows, use the up/down arrow keys
815 to scroll the current selection.
816 Use the space-bar to copy the current selection into the text-entry
817 window.
818 .IP
819 Typing any printable characters switches focus to the text-entry window,
820 entering that character as well as scrolling the directory and filename
821 windows to the closest match.
822 .IP
823 Typing the space character forces \fB\*p\fP to complete the current
824 name (up to the point where there may be a match against more than one
825 entry).
826 .IP
827 Use a carriage return or the "OK" button to accept the current value
828 in the text-entry window and exit.
829 .IP
830 On exit, the contents of the text-entry window are written to \fB\*p\fP's output.
831 .
832 .
833 .IP "\fB--gauge \fItext height width [percent]\fR"
834 A
835 \fBgauge\fP
836 box displays a meter along the bottom of the box.
837 The meter indicates the percentage.
838 New percentages are read from
839 standard input, one integer per line.
840 The meter is updated
841 to reflect each new percentage.
842 If the standard input reads the string "XXX",
843 then the first line following is taken as an integer percentage,
844 then subsequent lines up to another "XXX" are used for a new prompt.
845 The gauge exits when EOF is reached on the standard input.
846 .IP
847 The \fIpercent\fR value denotes the initial percentage shown in the meter.
848 If not specified, it is zero.
849 .IP
850 On exit, no text is written to \fB\*p\fP's output.
851 The widget accepts no input, so the exit status is always OK.
852 .
853 .
854 .IP "\fB--infobox \fItext height width"
855 An \fBinfo\fP box is basically a \fBmessage\fP box.
856 However, in this case, \fB\*p\fP
857 will exit immediately after displaying the message to the user.
858 The screen is not cleared when \fB\*p\fP
859 exits, so that the message will remain on the screen until the calling
860 shell script clears it later.
861 This is useful when you want to inform
862 the user that some operations are carrying on that may require some
863 time to finish.
864 .IP
865 On exit, no text is written to \fB\*p\fP's output.
866 Only an "OK" button is provided for input,
867 but an ESC exit status may be returned.
868 .
869 .
870 .IP "\fB--inputbox \fItext height width [init]"
871 An
872 \fBinput\fP
873 box is useful when you want to ask questions that
874 require the user to input a string as the answer.
875 If init is supplied
876 it is used to initialize the input string.
877 When entering the string,
878 the \fIbackspace\fP, \fIdelete\fP and cursor keys
879 can be used to correct typing errors.
880 If the input string is longer than
881 can fit in the dialog box, the input field will be scrolled.
882 .IP
883 On exit, the input string will be printed on \fB\*p\fP's output.
884 .
885 .
886 .IP "\fB--inputmenu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
887 An \fBinputmenu\fP box is very similar to an ordinary \fBmenu\fP box.
888 There are only a few differences between them:
889 .RS
890 .TP 4
891 1.
892 The entries are not automatically centered but left adjusted.
893 .TP
894 2.
895 An extra button (called \fIRename\/\fP) is implied to rename
896 the current item when it is pressed.
897 .TP
898 3.
899 It is possible to rename the current entry by pressing the
900 \fIRename\fP
901 button.
902 Then \fB\*p\fP will write the following on \fB\*p\fP's output.
903 .IP
904 RENAMED <tag> <item>
905 .RE
906 .
907 .
908 .IP "\fB--menu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
909 As its name suggests, a
910 \fBmenu\fP
911 box is a dialog box that can be used to present a list of choices in
912 the form of a menu for the user to choose.
913 Choices are displayed in the order given.
914 Each menu entry consists of a \fItag\fP string and an \fIitem\fP string.
915 The \fItag\fP
916 gives the entry a name to distinguish it from the other entries in the
917 menu.
918 The \fIitem\fP is a short description of the option that the entry represents.
919 The user can move between the menu entries by pressing the
920 cursor keys, the first letter of the \fItag\fP
921 as a hot-key, or the number keys \fI1\fP through \fI9\fP.
922 There are \fImenu-height\fP
923 entries displayed in the menu at one time, but the menu will be
924 scrolled if there are more entries than that.
925 .IP
926 On exit the \fItag\fP
927 of the chosen menu entry will be printed on \fB\*p\fP's output.
928 If the "\fB--help-button\fR" option is given, the corresponding help
929 text will be printed if the user selects the help button.
930 .
931 .nf
932 .IP "\fB--mixedform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen itype \fR] \fI..."
933 .fi
934 The \fBmixedform\fP dialog displays a form consisting of labels and fields,
935 much like the \fB--form\fP dialog.
936 It differs by adding a field-type parameter to each field's description.
937 Each bit in the type denotes an attribute of the field:
938 .RS
939 .TP 5
940 1
941 hidden, e.g., a password field.
942 .TP 5
943 2
944 readonly, e.g., a label.
945 .RE
946 .
947 .IP "\fB--mixedgauge \fItext height width percent \fR[ \fItag1 item1 \fR] \fI..."
948 A
949 \fBmixedgauge\fP
950 box displays a meter along the bottom of the box.
951 The meter indicates the percentage.
952 .IP
953 It also displays a list of the \fItag\/\fP- and \fIitem\/\fP-values at the
954 top of the box.
955 See \*l(3) for the tag values.
956 .IP
957 The \fItext\fP is shown as a caption between the list and meter.
958 The \fIpercent\fR value denotes the initial percentage shown in the meter.
959 .IP
960 No provision is made for reading data from the standard input as \fB--gauge\fP
961 does.
962 .IP
963 On exit, no text is written to \fB\*p\fP's output.
964 The widget accepts no input, so the exit status is always OK.
965 .
966 .IP "\fB--msgbox \fItext height width"
967 A \fBmessage\fP box is very similar to a \fByes/no\fP box.
968 The only difference between a \fBmessage\fP box and a \fByes/no\fP
969 box is that a \fBmessage\fP box has only a single \fBOK\fP button.
970 You can use this dialog box to display any message you like.
971 After reading the message, the user can press the \fIENTER\fP key so that
972 \fB\*p\fP will exit and the calling shell script can continue its operation.
973 .IP
974 If the message is too large for the space,
975 \fB\*p\fP may allow you to scroll it,
976 provided that the underlying curses implementation is capable enough.
977 In this case, a percentage is shown in the base of the widget.
978 .IP
979 On exit, no text is written to \fB\*p\fP's output.
980 Only an "OK" button is provided for input,
981 but an ESC exit status may be returned.
982 .
983 .IP "\fB--pause \fItext height width seconds\fR"
984 A
985 \fBpause\fP
986 box displays a meter along the bottom of the box.
987 The meter indicates how many seconds remain until the end of the pause.
988 The pause exits when timeout is reached
989 or the user presses the OK button
990 (status OK)
991 or the user presses the CANCEL button
992 or Esc key.
993 .IP "\fB--passwordbox \fItext height width [init]"
994 A \fBpassword\fP box is similar to an input box,
995 except that the text the user enters is not displayed.
996 This is useful when prompting for passwords or other
997 sensitive information.
998 Be aware that if anything is passed in "init", it
999 will be visible in the system's process table to casual snoopers.
1000 Also, it
1001 is very confusing to the user to provide them with a default password they
1002 cannot see.
1003 For these reasons, using "init" is highly discouraged.
1004 See "\fB--insecure\fP" if you do not care about your password.
1005 .IP
1006 On exit, the input string will be printed on \fB\*p\fP's output.
1007 .
1008 .
1009 .nf
1010 .IP "\fB--passwordform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
1011 .fi
1012 This is identical to \fB--form\fP except that all text fields are
1013 treated as \fBpassword\fP widgets rather than \fBinputbox\fP widgets.
1014 .
1015 .
1016 .IP "\fB--prgbox \fItext command height width"
1017 .IP "\fB--prgbox \fIcommand height width"
1018 A \fBprgbox\fP is very similar to a \fBprogrambox\fP.
1019 .IP
1020 This dialog box is used to display the output of a command that is
1021 specified as an argument to \fBprgbox\fP.
1022 .IP
1023 After the command completes, the user can press the \fIENTER\fP key so that
1024 \fBdialog\fP will exit and the calling shell script can continue its operation.
1025 .IP
1026 If three parameters are given, it displays the text under the title,
1027 delineated from the scrolling file's contents.
1028 If only two parameters are given, this text is omitted.
1029 .
1030 .
1031 .IP "\fB--programbox \fItext height width"
1032 .IP "\fB--programbox \fIheight width"
1033 A \fBprogrambox\fP is very similar to a \fBprogressbox\fP.
1034 The only difference between a \fBprogram\fP box and a \fBprogress\fP
1035 box is that a \fBprogram\fP box displays an \fBOK\fP button
1036 (but only after the command completes).
1037 .IP
1038 This dialog box is used to display the piped output of a command.
1039 After the command completes, the user can press the \fIENTER\fP key so that
1040 \fBdialog\fP will exit and the calling shell script can continue its operation.
1041 .IP
1042 If three parameters are given, it displays the text under the title,
1043 delineated from the scrolling file's contents.
1044 If only two parameters are given, this text is omitted.
1045 .
1046 .
1047 .IP "\fB--progressbox \fItext height width"
1048 .IP "\fB--progressbox \fIheight width"
1049 A \fBprogressbox\fP is similar to an \fBtailbox\fP,
1050 except that
1051 .RS
1052 .TP 3
1053 a) rather than displaying the contents of a file,
1054 it displays the piped output of a command and
1055 .TP 3
1056 b) it will exit when it reaches the end of the file
1057 (there is no "OK" button).
1058 .RE
1059 .IP
1060 If three parameters are given, it displays the text under the title,
1061 delineated from the scrolling file's contents.
1062 If only two parameters are given, this text is omitted.
1063 .
1064 .
1065 .IP "\fB--radiolist \fItext height width list-height \fR [ \fItag item status \fR] \fI..."
1066 A
1067 \fBradiolist\fP
1068 box is similar to a
1069 \fBmenu\fP
1070 box.
1071 The only difference is
1072 that you can indicate which entry is currently selected, by setting its
1073 .IR status " to " on "."
1074 .IP
1075 On exit, the tag of the selected item is written to \fB\*p\fP's output.
1076 .
1077 .
1078 .IP "\fB--tailbox \fIfile height width"
1079 Display text from a file in a dialog box, as in a "tail -f" command.
1080 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1081 A '0' resets the scrolling.
1082 .IP
1083 On exit, no text is written to \fB\*p\fP's output.
1084 Only an "OK" button is provided for input,
1085 but an ESC exit status may be returned.
1086 .
1087 .
1088 .nf
1089 .IP "\fB--rangebox \fItext height width min-value max-value default-value"
1090 .fi
1091 Allow the user to select from a range of values, e.g., using a slider.
1092 The dialog shows the current value as a bar (like the gauge dialog).
1093 Tabs or arrow keys move the cursor between the buttons and the value.
1094 When the cursor is on the value,
1095 you can edit it by:
1096 .RS
1097 .TP 5
1098 left/right cursor movement to select a digit to modify
1099 .TP 5
1100 +/-
1101 characters to increment/decrement the digit by one
1102 .TP 5
1103 0 through 9
1104 to set the digit to the given value
1105 .RE
1106 .IP
1107 Some keys are also recognized in all cursor positions:
1108 .RS
1109 .TP 5
1110 home/end
1111 set the value to its maximum or minimum
1112 .TP 5
1113 pageup/pagedown
1114 increment the value so that the slider moves by one column
1115 .RE
1116 .
1117 .
1118 .IP "\fB--tailboxbg \fIfile height width"
1119 Display text from a file in a dialog box as a background task,
1120 as in a "tail -f &" command.
1121 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1122 A '0' resets the scrolling.
1123 .IP
1124 \*L treats the background task specially if there are other
1125 widgets (\fB--and-widget\fP) on the screen concurrently.
1126 Until those widgets are closed (e.g., an "OK"),
1127 \fB\*p\fP will perform all of the tailboxbg widgets in the same process,
1128 polling for updates.
1129 You may use a tab to traverse between the widgets on the screen,
1130 and close them individually, e.g., by pressing \fIENTER\fP.
1131 Once the non-tailboxbg widgets are closed, \fB\*p\fP forks a copy of itself
1132 into the background, and prints its process id if the "\fB--no-kill\fP" option
1133 is given.
1134 .IP
1135 On exit, no text is written to \fB\*p\fP's output.
1136 Only an "EXIT" button is provided for input,
1137 but an ESC exit status may be returned.
1138 .IP
1139 NOTE:
1140 Older versions of \fB\*p\fP forked immediately and attempted to
1141 update the screen individually.
1142 Besides being bad for performance,
1143 it was unworkable.
1144 Some older scripts may not work properly with the polled scheme.
1145 .
1146 .
1147 .IP "\fB--textbox \fIfile height width"
1148 A
1149 \fBtext\fP
1150 box lets you display the contents of a text file in a dialog box.
1151 It is like a simple text file viewer.
1152 The user can move through the file by using the
1153 cursor, page-up, page-down
1154 and \fIHOME/END\fR keys available on most keyboards.
1155 If the lines are too long to be displayed in the box,
1156 the \fILEFT/RIGHT\fP
1157 keys can be used to scroll the text region horizontally.
1158 You may also use vi-style keys h, j, k, and l in place of the cursor keys,
1159 and B or N in place of the page-up and page-down keys.
1160 Scroll up/down using vi-style 'k' and 'j', or arrow-keys.
1161 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1162 A '0' resets the left/right scrolling.
1163 For more convenience,
1164 vi-style forward and backward searching functions are also provided.
1165 .IP
1166 On exit, no text is written to \fB\*p\fP's output.
1167 Only an "EXIT" button is provided for input,
1168 but an ESC exit status may be returned.
1169 .
1170 .
1171 .IP "\fB--timebox \fItext height [width hour minute second]"
1172 A dialog is displayed which allows you to select hour, minute and second.
1173 If the values for hour, minute or second are missing or negative,
1174 the current date's corresponding values are used.
1175 You can increment or decrement any of those using the
1176 left-, up-, right- and down-arrows.
1177 Use tab or backtab to move between windows.
1178 .IP
1179 On exit, the result is printed in the form hour:minute:second.
1180 The format can be overridden using the \fB--time-format\fP option.
1181 .
1182 .
1183 .IP "\fB--treeview \fItext height width list-height \fR[ \fItag item status depth \fR] \fI..."
1184 Display data organized as a tree.
1185 Each group of data contains a tag,
1186 the text to display for the item,
1187 its status ("on" or "off")
1188 and the depth of the item in the tree.
1189 .IP
1190 Only one item can be selected (like the \fBradiolist\fP).
1191 The tag is not displayed.
1192 .IP
1193 On exit, the tag of the selected item is written to \fB\*p\fP's output.
1194 .
1195 .
1196 .IP "\fB--yesno \fItext height width"
1197 A \fByes/no\fP dialog box of
1198 size \fIheight\fP rows by \fIwidth\fP columns will be displayed.
1199 The string specified by
1200 \fItext\fP
1201 is displayed inside the dialog box.
1202 If this string is too long to fit
1203 in one line, it will be automatically divided into multiple lines at
1204 appropriate places.
1205 The
1206 \fItext\fP
1207 string can also contain the sub-string
1208 .RI """" \en """"
1209 or newline characters
1210 .RI ` \en '
1211 to control line breaking explicitly.
1212 This dialog box is useful for
1213 asking questions that require the user to answer either yes or no.
1214 The dialog box has a
1215 \fBYes\fP
1216 button and a
1217 \fBNo\fP
1218 button, in which the user can switch between by pressing the
1219 .IR TAB " key."
1220 .IP
1221 On exit, no text is written to \fB\*p\fP's output.
1222 In addition to the "Yes" and "No" exit codes (see DIAGNOSTICS)
1223 an ESC exit status may be returned.
1224 .IP
1225 The codes used for "Yes" and "No" match those used for "OK" and "Cancel",
1226 internally no distinction is made.
1227 .
1228 .\" ************************************************************************
1229 .SS "Obsolete Options"
1230 .\" from cdialog 0.9a (Pako)
1231 .IP "\fB--beep"
1232 This was used to tell the original cdialog that it should make a beep
1233 when the separate processes of the tailboxbg widget would repaint the screen.
1234 .
1235 .\" from cdialog 0.9a (Pako)
1236 .IP "\fB--beep-after"
1237 Beep after a user has completed a widget by pressing one of the buttons.
1238 .
1239 .\" ************************************************************************
1240 .SH "RUN-TIME CONFIGURATION"
1241 .TP 4
1242 1.
1243 Create a sample configuration file by typing:
1244 .LP
1245 .Ex
1246 \*p --create-rc \fIfile\fP
1247 .Ee
1248 .TP 4
1249 2.
1250 At start,
1251 \fB\*p\fP
1252 determines the settings to use as follows:
1253 .RS
1254 .TP 4
1255 a)
1256 if environment variable
1257 \fBDIALOGRC\fP
1258 is set, its value determines the name of the configuration file.
1259 .TP 4
1260 b)
1261 if the file in (a) is not found, use the file
1262 \fI$HOME/.dialogrc\fP
1263 as the configuration file.
1264 .TP 4
1265 c)
1266 if the file in (b) is not found, try using the GLOBALRC file determined at
1267 compile-time, i.e., \fI/etc/dialogrc\fP.
1268 .TP 4
1269 d)
1270 if the file in (c) is not found, use compiled in defaults.
1271 .RE
1272 .TP 4
1273 3.
1274 Edit the sample configuration file and copy it to some place that
1275 \fB\*p\fP
1276 can find, as stated in step 2 above.
1277 .
1278 .\" ************************************************************************
1279 .SH "KEY BINDINGS"
1280 You can override or add to key bindings in \fB\*p\fP
1281 by adding to the configuration file.
1282 \fB\*L\fP's \fBbindkey\fP command maps single keys to its internal coding.
1283 .Ex
1284 bindkey \fIwidget\fP \fIcurses_key\fP \fIdialog_key\fP
1285 .Ee
1286 .PP
1287 The \fIwidget\fP name can be "*" (all widgets), or
1288 specific widgets such as \fBtextbox\fP.
1289 Specific widget bindings override the "*" bindings.
1290 User-defined bindings override the built-in bindings.
1291 .PP
1292 The \fIcurses_key\fP can be any of the names derived from
1293 \fBcurses.h\fP, e.g., "HELP" from "KEY_HELP".
1294 \fB\*L\fP also recognizes ANSI control characters such as "^A", "^?",
1295 as well as C1-controls such as "~A" and "~?".
1296 Finally, it allows any single character to be escaped with a backslash.
1297 .PP
1298 \fB\*L\fP's internal keycode names correspond to the
1299 \fBDLG_KEYS_ENUM\fP type in
1300 \fBdlg_keys.h\fP, e.g., "HELP" from "DLGK_HELP".
1301 .SS Widget Names
1302 .PP
1303 Some widgets (such as the formbox) have an area where fields can be edited.
1304 Those are managed in a subwindow of the widget, and
1305 may have separate keybindings from the main widget
1306 because the subwindows are registered using a different name.
1307 .TS
1308 center tab(/) ;
1309 lI lI lI
1310 _ _ _
1311 l l l .
1312 Widget/Window name/Subwindow Name
1313 calendar/calendar
1314 checklist/checklist
1315 editbox/editbox/editbox2
1316 form/formbox/formfield
1317 fselect/fselect/fselect2
1318 inputbox/inputbox/inputbox2
1319 menu/menubox/menu
1320 msgbox/msgbox
1321 pause/pause
1322 progressbox/progressbox
1323 radiolist/radiolist
1324 tailbox/tailbox
1325 textbox/textbox/searchbox
1326 timebox/timebox
1327 yesno/yesno
1328 _
1329 .TE
1330 .PP
1331 Some widgets are actually other widgets,
1332 using internal settings to modify the behavior.
1333 Those use the same widget name as the actual widget:
1334 .TS
1335 center tab(/) ;
1336 lI lI
1337 _ _
1338 l l .
1339 Widget/Actual Widget
1340 dselect/fselect
1341 infobox/msgbox
1342 inputmenu/menu
1343 mixedform/form
1344 passwordbox/inputbox
1345 passwordform/form
1346 prgbox/progressbox
1347 programbox/progressbox
1348 tailboxbg/tailbox
1349 _
1350 .TE
1351 .SS Built-in Bindings
1352 This manual page does not list the key bindings for each widget,
1353 because that detailed information can be obtained by running \fB\*p\fP.
1354 If you have set the \fB--trace\fP option,
1355 \fB\*p\fP writes the key-binding information for each widget
1356 as it is registered.
1357 .SS Example
1358 Normally \fB\*p\fP uses different keys for navigating between the buttons
1359 and editing part of a dialog versus navigating within the editing part.
1360 That is, tab (and back-tab) traverse buttons
1361 (or between buttons and the editing part),
1362 while arrow keys traverse fields within the editing part.
1363 Tabs are also recognized as a special case for traversing between
1364 widgets, e.g., when using multiple tailboxbg widgets.
1365 .PP
1366 Some users may wish to use the same key for traversing within the
1367 editing part as for traversing between buttons.
1368 The form widget is written to support this sort of redefinition of
1369 the keys, by adding a special group in \fBdlgk_keys.h\fP
1370 for "form" (left/right/next/prev).
1371 Here is an example binding demonstrating how to do this:
1372 .Ex
1373 bindkey formfield TAB  form_NEXT
1374 bindkey formbox   TAB  form_NEXT
1375 bindkey formfield BTAB form_prev
1376 bindkey formbox   BTAB form_prev
1377 .Ee
1378 .PP
1379 That type of redefinition would not be useful in other widgets,
1380 e.g., calendar, due to the potentially large number of fields to traverse.
1381 .
1382 .\" ************************************************************************
1383 .SH ENVIRONMENT
1384 .TP 15
1385 \fBDIALOGOPTS\fP
1386 Define this variable to apply any of the common options to each widget.
1387 Most of the common options are reset before processing each widget.
1388 If you set the options in this environment variable,
1389 they are applied to \fB\*p\fP's state after the reset.
1390 As in the "\fB--file\fP" option,
1391 double-quotes and backslashes are interpreted.
1392 .IP
1393 The "\fB--file\fP" option is not considered a common option
1394 (so you cannot embed it within this environment variable).
1395 .TP 15
1396 \fBDIALOGRC\fP
1397 Define this variable if you want to specify the name of the configuration file
1398 to use.
1399 .TP 15
1400 \fBDIALOG_CANCEL\fP
1401 .TP 15
1402 \fBDIALOG_ERROR\fP
1403 .TP 15
1404 \fBDIALOG_ESC\fP
1405 .TP 15
1406 \fBDIALOG_EXTRA\fP
1407 .TP 15
1408 \fBDIALOG_HELP\fP
1409 .TP 15
1410 \fBDIALOG_ITEM_HELP\fP
1411 .TP 15
1412 \fBDIALOG_OK\fP
1413 Define any of these variables to change the exit code on
1414 Cancel (1),
1415 error (\-1),
1416 ESC (255),
1417 Extra (3),
1418 Help (2),
1419 Help with \fB--item-help\fP (2),
1420 or OK (0).
1421 Normally shell scripts cannot distinguish between \-1 and 255.
1422 .TP 15
1423 \fBDIALOG_TTY\fP
1424 Set this variable to "1" to provide compatibility with older versions
1425 of \fB\*p\fP which assumed that if the script redirects the standard output,
1426 that the "\fB--stdout\fP" option was given.
1427 .SH FILES
1428 .TP 20
1429 \fI$HOME/.dialogrc\fP
1430 default configuration file
1431 .SH EXAMPLES
1432 The \fB\*p\fP sources contain several samples
1433 of how to use the different box options and how they look.
1434 Just take a look into the directory \fBsamples/\fP of the source.
1435 .SH DIAGNOSTICS
1436 Exit status is subject to being overridden by environment variables.
1437 The default values and corresponding environment variables
1438 that can override them are:
1439 .TP 5
1440 0
1441 if the \fBYES\fP or \fBOK\fP button is pressed (DIALOG_OK).
1442 .TP 5
1443 1
1444 if the
1445 .BR No " or " Cancel
1446 button is pressed (DIALOG_CANCEL).
1447 .TP 5
1448 2
1449 if the
1450 .BR Help
1451 button is pressed (DIALOG_HELP),
1452 .br
1453 except as noted below about DIALOG_ITEM_HELP.
1454 .TP 5
1455 3
1456 if the
1457 .BR Extra
1458 button is pressed (DIALOG_EXTRA).
1459 .TP 5
1460 4
1461 if the
1462 .BR Help
1463 button is pressed,
1464 .br
1465 and the \fB--item-help\fP option is set
1466 .br
1467 and the DIALOG_ITEM_HELP environment variable is set to 4.
1468 .IP
1469 While any of the exit-codes can be overridden using environment variables,
1470 this special case was introduced in 2004 to simplify compatibility.
1471 \fB\*L\fP uses DIALOG_ITEM_HELP(4) internally,
1472 but unless the environment variable is also set,
1473 it changes that to DIALOG_HELP(2) on exit.
1474 .TP 5
1475 \-1
1476 if errors occur inside \fB\*p\fP (DIALOG_ERROR)
1477 or \fB\*p\fP exits because the \fIESC\fP key (DIALOG_ESC) was pressed.
1478 .
1479 .\" ************************************************************************
1480 .SH PORTABILITY
1481 \fB\*L\fP works with X/Open curses.
1482 However, some implementations have deficiencies:
1483 .RS 3
1484 .bP
1485 HPUX curses (and perhaps others) do not open the terminal properly for
1486 the \fInewterm\fP function.
1487 This interferes with \fB\*p\fP's \fB--input-fd\fP option,
1488 by preventing cursor-keys and similar escape sequences from being recognized.
1489 .bP
1490 NetBSD 5.1 curses has incomplete support for wide-characters.
1491 \fB\*p\fP will build, but not all examples display properly.
1492 .RE
1493 .\" ************************************************************************
1494 .SH COMPATIBILITY
1495 You may want to write scripts which run with other \fBdialog\fP "clones".
1496 .SS ORIGINAL DIALOG
1497 First, there is the "original" \fBdialog\fP program to consider (versions
1498 0.3 to 0.9).
1499 It had some misspelled (or inconsistent) options.
1500 The \fB\*p\fP program maps those deprecated options to the preferred ones.
1501 They include:
1502 .RS
1503 .TS
1504 tab(/) ;
1505 lI lI
1506 _ _
1507 l l.
1508 Option/Treatment
1509 \fB--beep-after\fP/ignored
1510 \fB--guage\fP/mapped to \fB--gauge\fP
1511 _
1512 .TE
1513 .RE
1514 .SS XDIALOG
1515 Technically, "\fBXdialog\fP",
1516 this is an X application.
1517 With some care, it is possible to write useful scripts that work
1518 with both \fBXdialog\fP and \fBdialog\fP.
1519 .PP
1520 The \fB\*p\fP program ignores these options which are recognized
1521 by \fBXdialog\fP:
1522 .RS
1523 .TS
1524 tab(/) ;
1525 lI lI
1526 _ _
1527 l l.
1528 Option/Treatment
1529 \fB--allow-close\fP/ignored
1530 \fB--auto-placement\fP/ignored
1531 \fB--fixed-font\fP/ignored
1532 \fB--icon\fP/ignored
1533 \fB--keep-colors\fP/ignored
1534 \fB--no-close\fP/ignored
1535 \fB--no-cr-wrap\fP/ignored
1536 \fB--screen-center\fP/ignored
1537 \fB--separator\fP/mapped to \fB--separate-output\fP
1538 \fB--smooth\fP/ignored
1539 \fB--under-mouse\fP/ignored
1540 \fB--wmclass\fP/ignored
1541 _
1542 .TE
1543 .RE
1544 .PP
1545 \fBXdialog\fP's manpage has a section discussing its compatibility with \fB\*p\fP.
1546 There are some differences not shown in the manpage.
1547 For example, the html documentation states
1548 .RS
1549 .PP
1550 Note: former Xdialog releases used the "\en" (line feed) as a
1551 results separator for the checklist widget;
1552 this has been changed to "/" in Xdialog v1.5.0
1553 to make it compatible with (c)dialog.
1554 In your old scripts using the Xdialog checklist, you
1555 will then have to add the \fB--separate-output\fP option before the
1556 \fB--checklist\fP one.
1557 .RE
1558 .PP
1559 \fB\*L\fP has not used a different separator;
1560 the difference was likely due to confusion regarding some script.
1561 .SS WHIPTAIL
1562 Then there is \fBwhiptail\fP.
1563 For practical purposes, it is maintained by Debian
1564 (very little work is done by its upstream developers).
1565 Its documentation (README.whiptail) claims
1566 .Ex
1567 whiptail(1) is a lightweight replacement for \*p(1),
1568 to provide dialog boxes for shell scripts.
1569 It is built on the
1570 newt windowing library rather than the ncurses library, allowing
1571 it to be smaller in embedded environments such as installers,
1572 rescue disks, etc.
1573
1574 whiptail is designed to be drop-in compatible with \*p, but
1575 has less features: some dialog boxes are not implemented, such
1576 as tailbox, timebox, calendarbox, etc.
1577 .Ee
1578 .PP
1579 Comparing actual sizes (Debian testing, 2007/1/10):
1580 The total of sizes for \fBwhiptail\fP,
1581 the newt, popt and slang libraries is 757\ KB.
1582 The comparable number for \fB\*p\fP (counting ncurses) is 520\ KB.
1583 Disregard the first paragraph.
1584 .PP
1585 The second paragraph is misleading, since \fBwhiptail\fP
1586 also does not work for common options of \fB\*p\fP,
1587 such as the gauge box.
1588 \fBwhiptail\fP is less compatible with \fB\*p\fP than the
1589 original mid-1990s dialog 0.4 program.
1590 .PP
1591 \fBwhiptail\fP's manpage borrows features from \fB\*p\fP, e.g.,
1592 but oddly cites only \fB\*p\fP versions up to 0.4 (1994) as a source.
1593 That is, its manpage refers to features which
1594 were borrowed from more recent versions of \fB\*p\fP, e.g.,
1595 .bP
1596 \fB--gauge\fP (from 0.5)
1597 .bP
1598 \fB--passwordbox\fP (from Debian changes in 1999),
1599 .bP
1600 \fB--default-item\fP (from \fB\*p\fP 2000/02/22),
1601 .bP
1602 \fB--output-fd\fP (from \fB\*p\fP 2002/08/14).
1603 .PP
1604 Somewhat humorously, one may note that the \fBpopt\fP feature
1605 (undocumented in its manpage)
1606 of using a "--" as an escape was documented in \fB\*p\fP's manpage about
1607 a year before it was mentioned in \fBwhiptail\fP's manpage.
1608 \fBwhiptail\fP's manpage incorrectly attributes that to \fBgetopt\fP
1609 (and is inaccurate anyway).
1610 .PP
1611 Debian uses \fBwhiptail\fP for the official \fB\*p\fP variation.
1612 .PP
1613 The \fB\*p\fP program ignores or maps these options which are recognized
1614 by \fBwhiptail\fP:
1615 .RS
1616 .TS
1617 tab(/) ;
1618 lI lI
1619 _ _
1620 l l.
1621 Option/Treatment
1622 \fB--cancel-button\fP/mapped to \fB--cancel-label\fP
1623 \fB--fb\fP/ignored
1624 \fB--fullbutton\fP/ignored
1625 \fB--no-button\fP/mapped to \fB--no-label\fP
1626 \fB--nocancel\fP/mapped to \fB--no-cancel\fP
1627 \fB--noitem\fP/mapped to \fB--no-items\fP
1628 \fB--notags\fP/mapped to \fB--no-tags\fP
1629 \fB--ok-button\fP/mapped to \fB--ok-label\fP
1630 \fB--scrolltext\fP/mapped to \fB--scrollbar\fP
1631 \fB--topleft\fP/mapped to \fB--begin 0 0\fP
1632 \fB--yes-button\fP/mapped to \fB--yes-label\fP
1633 _
1634 .TE
1635 .RE
1636 .LP
1637 There are visual differences which are not addressed by command-line options:
1638 .bP
1639 \fB\*p\fP centers lists within the window.
1640 \fBwhiptail\fP typically puts lists against the left margin.
1641 .bP
1642 \fBwhiptail\fP uses angle brackets ("<" and ">") for marking buttons.
1643 \fB\*p\fP uses square brackets.
1644 .bP
1645 \fBwhiptail\fP marks the limits of subtitles with vertical bars.
1646 \fB\*p\fP does not mark the limits.
1647 .bP
1648 \fBwhiptail\fP attempts to mark the top/bottom cells of a scrollbar
1649 with up/down arrows.
1650 When it cannot do this,
1651 it fills those cells with the background color
1652 of the scrollbar and confusing the user.
1653 \fB\*p\fP uses the entire scrollbar space,
1654 thereby getting better resolution.
1655 .\" ************************************************************************
1656 .SH BUGS
1657 Perhaps.
1658 .SH AUTHOR
1659 .LP
1660 Thomas E.\& Dickey (updates for 0.9b and beyond)
1661 .SH CONTRIBUTORS
1662 Kiran Cherupally \(en the mixed form and mixed gauge widgets.
1663 .LP
1664 Tobias C.\& Rittweiler
1665 .LP
1666 Valery Reznic \(en the form and progressbox widgets.
1667 .LP
1668 Yura Kalinichenko adapted the gauge widget as "pause".
1669 .PP
1670 This is a rewrite (except as needed to provide compatibility)
1671 of the earlier version of \fB\*p 0.9a\fP,
1672 which lists as authors:
1673 .bP
1674 Savio Lam \(en version 0.3, "dialog"
1675 .bP
1676 Stuart Herbert \(en patch for version 0.4
1677 .bP
1678 Marc Ewing \(en the gauge widget.
1679 .bP
1680 Pasquale De Marco "Pako" \(en version 0.9a, "cdialog"