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