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