Bump to release 1.4.0
[smenu.git] / smenu.1
blobaa74110e8a1d2b7243c2815c79371c9254dbc4df
1 .\" ###################################################################
2 .\" Copyright 2015, Pierre Gentile (p.gen.progs@gmail.com)
3 .\"
4 .\" This Source Code Form is subject to the terms of the Mozilla Public
5 .\" License, v. 2.0. If a copy of the MPL was not distributed with this
6 .\" file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 .\" ###################################################################
8 .TH smenu 1
9 .SH NAME
10 smenu - filter that allows one to interactively select a word from stdin
11 and outputs the selection to stdout.
12 .SH SYNOPSIS
13 .nf
14   [\fB*-h\fP|\fB-help\fP]
15   [\fB*-H\fP|\fB-long_help\fP]
16   [\fB*-?\fP|\fB-u\fP|\fB-usage\fP]
17   [\fB*-V\fP|\fB-version\fP]
18   [\fB-n\fP|\fB-lines\fP|\fB-height\fP [\fIheight\fP]]
19   [\fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP... \fIregex\fP]
20   [\fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP... \fIregex\fP]
21   [\fB-m\fP|\fB-msg\fP|\fB-message\fP|\fB-title\fP \fImessage\fP]
22   [\fB-!\fP|\fB-int\fP|\fB-int_string\fP [\fIstring\fP]]
23   [\fB-a\fP|\fB-attr\fP|\fB-attributes\fP \fIprefix:attr\fP...]
24   [\fB-1\fP|\fB-l1\fP|\fB-level1\fP \fIregex\fP [\fIattr\fP]]
25   [\fB-2\fP|\fB-l2\fP|\fB-level2\fP \fIregex\fP [\fIattr\fP]]
26   [\fB-3\fP|\fB-l3\fP|\fB-level3\fP \fIregex\fP [\fIattr\fP]]
27   [\fB-4\fP|\fB-l4\fP|\fB-level4\fP \fIregex\fP [\fIattr\fP]]
28   [\fB-5\fP|\fB-l5\fP|\fB-level5\fP \fIregex\fP [\fIattr\fP]]
29   [\fB-6\fP|\fB-l6\fP|\fB-level6\fP \fIregex\fP [\fIattr\fP]]
30   [\fB-7\fP|\fB-l7\fP|\fB-level7\fP \fIregex\fP [\fIattr\fP]]
31   [\fB-8\fP|\fB-l8\fP|\fB-level8\fP \fIregex\fP [\fIattr\fP]]
32   [\fB-9\fP|\fB-l9\fP|\fB-level9\fP \fIregex\fP [\fIattr\fP]]
33   [\fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP [\fIdelim\fP]]
34   [\fB-z\fP|\fB-zap\fP|\fB-zap_glyphs\fP \fIbytes\fP]
35   [\fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP [\fIdelim\fP]]
36   [\fB-0\fP|\fB-noat\fP|\fB-no_auto_tag\fP]
37   [\fB-p\fP|\fB-at\fP|\fB-auto_tag\fP]
38   [\fB-N\fP|\fB-number\fP... [\fIregex\fP...]]
39   [\fB-U\fP|\fB-unnumber\fP... [\fIregex\fP...]]
40   [\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP]
41   [\fB-D\fP|\fB-data\fP|\fB-options\fP [\fIparameter\fP...]
42   [\fB-b\fP|\fB-blank\fP]
43   [\fB-M\fP|\fB-middle\fP|\fB-center\fP]
44   [\fB-d\fP|\fB-restore\fP|\fB-delete\fP|\fB-clean\fP|\
45 \fB-delete_window\fP|\fB-clean_window\fP]
46   [\fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP]
47   [\fB-l\fP|\fB-line\fP|\fB-line_mode\fP]
48   [\fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP [\fIcols\fP]]
49   [\fB-w\fP|\fB-wide\fP|\fB-wide_mode\fP]
50   [\fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP... \
51 [\fIdirective\fP][\fIselector\fP...]]
52   [\fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP... \
53 [\fIdirective\fP][\fIselector\fP...]]
54   [\fB-al\fP|\fB-align\fP... [\fIre_selectors\fP...]]
55   [\fB-A\fP|\fB-fc\fP|\fB-first_column\fP \fIregex\fP]
56   [\fB-Z\fP|\fB-lc\fP|\fB-last_column\fP \fIregex\fP]
57   [\fB-g\fP|\fB-gutter\fP [\fIstring\fP]]
58   [\fB-k\fP|\fB-ks\fP|\fB-keep_spaces\fP]
59   [\fB-W\fP|\fB-ws\fP|\fB-wd\fP|\fB-word_delimiters\fP|\
60 \fB-word_separators\fP \
61 \fIbytes\fP]
62   [\fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\
63 \fB-line_separators\fP \
64 \fIbytes\fP]
65   [\fB-q\fP|\fB-no_bar\fP|\fB-no_scroll_bar\fP]
66   [\fB-no_hbar\fP|\fB-no_hor_scroll_bar\fP]
67   [\fB-S\fP|\fB-subst\fP... \fI/regex/repl/opts\fP]
68   [\fB-I\fP|\fB-si\fP|\fB-subst_included\fP... \fI/regex/repl/opts\fP]
69   [\fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP... \fI/regex/repl/opts\fP]
70   [\fB-ES\fP|\fB-early_subst\fP... \fI/regex/repl/opts\fP]
71   [\fB-/\fP|\fB-search_method\fP \fIprefix\fP|\fIsubstring\fP|\fIfuzzy\fP]
72   [\fB-s\fP|\fB-sp\fP|\fB-start\fP|\fB-start_pattern\fP \fIpattern\fP]
73   [\fB-x\fP|\fB-tmout\fP|\fB-timeout\fP \fItype\fP [\fIword\fP] \fIdelay\fP]
74   [\fB-X\fP|\fB-htmout\fP|\fB-hidden_timeout\fP \fItype\fP [\fIword\fP] \
75 \fIdelay\fP]
76   [\fB-r\fP|\fB-auto_validate\fP]
77   [\fB-is\fP|\fB-incremental_search\fP]
78   [\fB-v\fP|\fB-vb\fP|\fB-visual_bell\fP]
79   [\fB-Q\fP|\fB-ignore_quotes\fP]
80   [\fB-lim\fP|\fB-limits\fP \fIlimit:value\fP...]
81   [\fB-f\fP|\fB-forgotten_timeout\fP|\fB-global_timeout\fP \fItimeout\fP]
82   [\fB-nm\fP|\fB-no_mouse\fP]
83   [\fB-br\fP|\fB-buttons\fP|\fB-button_remapping\fP \fInew_button_1\fP \
84 \fInew_button_3\fP]
85   [\fB-dc\fP|\fB-dcd\fP|\fB-double_click\fP|\fB-double_click_delay\fP \
86 \fIdelay_in_ms\fP]
87   [\fB-sb\fP|\fB-sbw\fP|\fB-show_blank_words\fP [\fIblank_char\fP]]
90   selectors    ::= See the \fB-C\fP|\fB-cs\fP|\fB-cols\fP description for \
91 more details.
92   re_selectors ::= \fIRE\fP,...
93   directive    ::= \fIi\fP|\fII\fP|\fIe\fP|\fIE\fP|\
94 \fIl\fP|\fIL\fP|\fIr\fP|\fIR\fP|\fIc\fP|\fIC\fP
95   parameter    ::= [l|r:<char>]|[a:left|right]|[p:included|all|[w:<num>]|
96                 [f:yes|no]|[o:<num>[+]]|[n:<num>]|[i:<num>]|[d:<char>]|
97                 [s:<num>]|[h:trim|cut|keep]
98   attr         ::= [fg][/bg][,style]
99   RE           ::= \fB<char>\fIregex\fB<char>\fR
101   selectors and RE can be freely mixed.
102   style can only contain a maximum of 6 characters.
103   <char> in RE is any non-blank ASCII character except ','.
106 Note that some parameters require that others have been previously
107 entered in the command line to be accepted.
108 .SH DESCRIPTION
109 This small utility acts as a filter when no input file is given
110 (reads from stdin and writes to stdout) or takes its inputs from that file.
112 All words read are presented in a scrolling window on the terminal \fBat
113 the current cursor position\fP, without clearing the screen first.
115 The selection cursor is initially positioned on the first selectable word
116 by default.
118 In this window, words can be displayed next to each other, with a fixed
119 size, or in rows or columns respecting the line ends as input.
120 In column mode, words can also be centred, left aligned or right aligned.
121 See the options \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP,
122 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP and
123 \fB-al\fP|\fB-align\fP for more information.
125 There are options to explicitly or implicitly include/exclude or align words
126 using extended regular expressions.
127 Note that once certain words are explicitly excluded, they cannot be
128 re-included later.
130 Excluded words are skipped when the selection cursor is moved and cannot
131 be searched for.
133 The \fB-W\fP|\fB-ws\fP|\fB-wd\fP|\fB-word_delimiters\fP|\fB-word_separators\fP
134 option can be used to set the characters (or multibyte
135 sequences) which will be used to delimit the input words.
136 The default delimiters are: \fISPACE\fP, \fI\\t\fP and \fI\\n\fP.
139 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP
140 has a similar meaning for lines.
142 Special character sequences formed by a \fI\\\fP followed by one of the
143 characters \fIa\fP \fIb\fP \fIt\fP \fIn\fP \fIv\fP \fIf\fP \fIr\fP and
144 \fI\\\fP are understood and have their traditional meanings.
146 smenu strives to support UTF-8 encoding, both as input and output.
147 \fBUTF-8\fP sequences introduced by \fI\\u\fP and \fI\\U\fP are also
148 understood.
150 \fBWarning\fP, when used together, it is important to know that all
151 sequences beginning with \fI\\U\fP will be interpreted before the
152 beginning of the interpretation of sequences beginning with \fI\\u\fP.
154 \fI\\u\fP can be followed by 2,4,6 or 8 hexadecimal characters composing
155 an \fBUTF-8\fP bytestring.
156 Here is an example of using \fI\\u\fP to compose a \fBLatin Small Letter E
157 with Acute\fP: \fI\\uc3a9\fP.
159 \fI\\U\fP must be followed by exactly 6 hexadecimal digits, \fBincluding\fP
160 leading zeros, that represent a Unicode codepoint according to ISO
161 10646 UCS-4.
162 The \fBLatin Small Letter E with Acute\fP of the previous example
163 (codepoint \fBU+00E9\fP) can then be represented as \fI\\U0000e9\fP.
165 Note that with most shells, the \fI\\\fP before \fIu\fP and \fIU\fP
166 need to be protected or escaped.
168 Quotations (single and double) in the input stream can be used to ignore
169 the word separators so that a group of words are taken as a single entity.
171 Non printable characters in words that are not delimiters are
172 converted to their traditional form (\fI\\n\fP for end-of-line,
173 \fI\\t\fP for tabulation...) by default.
175 An invalid \fBUTF-8\fP sequence or other non-printable character will be
176 replaced by a dot (\fI.\fP) by default.
178 There is nevertheless a possibility to change this substitution character
179 with another \fBASCII\fP printable one with the help of the command line
180 option \fB-.\fP|\fB-dot\fP|\fB-invalid\fP.
182 \fBWarning\fP, \fBUTF-8\fP encoded codepoints are quietly converted
183 into the substitution character when the user locale is not \fBUTF-8\fP
184 aware like \fBPOSIX\fP or \fBC\fP by example.
186 Words containing only spaces, entered directly or resulting from a
187 substitution, are also rejected unless they are not selectable.
188 This allows special effects like creating blank lines for example.
189 These words are also kept in column mode, selectable or not.
191 smenu has an option to define a set of characters or \fBUTF-8\fP sequences
192 which should be ignored when reading words.
193 This can be very useful when dealing with inputs where the EOL sequence
194 consists in more than one character.
196 A typical example is DOS or Windows files with lines ending with
197 \fICRLF\fP.
198 In such a case one might decide to ignore all \fICR\fP characters from
199 the input.
201 .SS "Keyboard and mouse usage."
202 \fBkeyboard\fP:
203 .RS 2
204 The cursor can be moved in any direction using the arrow keys of the
205 keyboard: \fB\(<-\fP, \fB\(da\fP, \fB\(ua\fP, \fB\(->\fP
206 or the \fIvi\fP direction keys: \fBh\fP, \fBj\fP, \fBk\fP and \fBl\fP.
207 The \fBHOME\fP, \fBEND\fP, \fBPgDn\fP and \fBPgUp\fP keys can also be
208 used when available.
210 The meaning of the movement keys is as follows:
212 tab(@);
213 l l.
214 \fB\(<-\fP, \fBh\fP@Previous word
215 \fBSHIFT HOME\fP, \fBCTRL\ \(<-\fP, \fBH\fP@Start of line in column or line mode
216 \fB\(ua\fP, \fBk\fP@Previous line
217 \fBPgUp\fP, \fBK\fP@Previous page
218 \fBHOME\fP@First word of the window
219 \fBCTRL\ HOME\fP, \fBSHIFT\ HOME\fP, \fBCTRL\ K\fP@First word
220 \fB<\fP@The window's content is shifted to the
221 @left while keeping the cursor visible
223 \fB\(->\fP, \fBl\fP@Next word
224 \fBSHIFT END\fP, \fBCTRL\ \(->\fP, \fBL\fP@End of line in column or line mode
225 \fB\(da\fP, \fBj\fP@Next line
226 \fBPgDn\fP, \fBJ\fP@Next page
227 \fBEND\fP@Last word of the window
228 \fBCTRL\ END\fP, \fBSHIFT\ END\fP, \fBCTRL\ J\fP@Last word
229 \fB>\fP@The window's content is shifted to the
230 @right while keeping the cursor visible
233 \fBCTRL\ \(<-\fP/\fBH\fP (resp. \fBCTRL\ \(->\fP/\fBL\fP) places the cursor
234 so that a maximum number of words (selectable or not) are visible to
235 the left (reps. right) side of the window.
237 When the content of the window is shifted to the left or right using
238 \fB<\fP or \fB>\fP or the mouse, the cursor always highlights the same
239 word and remains visible.
240 This can block sole shifting operations.
243 \fBMouse:\fP
244 .RS 2
245 With many terminal emulators, it is possible to use the mouse to interact
246 with the screen content.
248 \fBWarning\fP, if groups of extended graphemes are present in the input,
249 mouse-based selection is only accurate if the terminal correctly displays
250 these graphemes.
251 An example of a non-functional terminal is xterm, an example of a
252 functional terminal is wezterm.
254 When the mouse is supported, the cursor can turn into an arrow (but
255 not always) and the mouse can then be used as a point and click device
256 as follows:
258 \fBFirst (usually left) mouse button (note that buttons can be remapped)\fP:
259 .RS 2
260 .IP \(bu 2
261 A click on a word selects it if it is selectable.
262 .IP \(bu 2
263 A click on a word while holding the CTRL key pressed when tagging/pinning
264 is activated marks/unmarks this word.
265 .IP \(bu 2
266 A Click at the ends of the vertical scroll bar (if present) is equivalent
267 to pressing the keyboard's up or down arrow.
269 A click anywhere else on the vertical scroll bar moves the cursor to
270 another word, depending on where you click.
272 The new current word will be positioned at the beginning of a line
273 if possible.
275 A click at the ends of the horizontal scroll bar (if present) is
276 equivalent to pressing the keyboard's left or right arrow.
278 A click anywhere else on the horizontal scroll bar moves the cursor left
279 of right on the line containing the cursor, but does not move it further
280 than the first or last word on that line.
281 .IP \(bu 2
282 A double-click on a word selects it, if selectable, and acts as if the
283 Enter key had been pressed, the double-click delay being configurable.
284 .IP \(bu 2
285 A click on the left or right horizontal arrow of each line (when visible)
286 shifts the content of the window to the left or right, one word at a time.
288 Nothing happens if the cursor risks leaving the window.
290 Note that clicking on a left-facing arrow in an empty line means that
291 not all the words in that line could be displayed because of previous
292 shifts or moves.
293 In this case, smenu will try to display the last word of this line but
294 it is not always possible as the cursor must remain visible.
296 The keyboard commands \fB<\fP and \fB>\fP can be used in such a case
297 because the cursor is already on the current line.
300 \fBThird (usually right) mouse button\fP:
301 .RS 2
302 .IP \(bu 2
303 When tagging or pinning is enabled, a click on a word tags/untags it if
304 it is selectable.
305 .IP \(bu 2
306 When tagging or pinning is enabled, a click on a word while holding the
307 CTRL key pressed has the following actions:
308 .RS 2
309 .IP - 2
310 If the word clicked is selectable and no word is already marked then
311 marks it.
312 .IP - 2
313 If a word is marked and the clicked word is selectable and is not the
314 marked word, then:
315 .RS 2
316 .IP + 2
317 In column mode, if the marked word is in the same column/line as the
318 clicked word, tags all words bounded by those words in that column/line
319 as if \fBZ\fP the keyboard command were used.
320 .IP + 2
321 In line or column mode, if the marked word is in the same line as the
322 clicked word, tags all words bounded by those words in that line.
323 .IP + 2
324 Otherwise, tags all words bounded by the marked word and the
325 clicked one.
326 .IP + 2
327 In all cases, the mark is removed.
332 \fBMouse wheel\fP:
333 .RS 2
334 .IP \(bu 2
335 Rotating the mouse wheel scrolls the contents of the window one line up
336 or down.
337 .IP \(bu 2
338 Rotating the mouse wheel while holding down the \fBCTRL\fP key scrolls
339 the contents of the window one page up or down.
341 This feature may not work depending on the terminal and operating system.
343 Be sure to use the wheel when the mouse pointer is over the smenu
344 window, as some terminal emulators may otherwise zoom the screen in
345 and out instead.
348 Remember that mouse support does not disable the keyboard, so use the
349 keys instead if the mouse is not working properly.
351 Some terminals may not report clicks after the 223rd line or column due
352 to a limitation of the old X11 mouse tracking protocol, one example of
353 such a terminal emulator is screen < 4.7.0.
354 tmux as well as screen >= 4.7.0 are fine.
356 Keyboard and mouse can be used at the same time.
357 .TP 2
358 \fBRemark 1.\fP
359 Some X-Window terminal emulators may not support the
360 enable/disable bracketed pastes escape sequence, in such a case if
361 may be necessary to explicitly clear the content of the paste buffer
362 before running smenu so that the mouse buttons (especially for pasting)
363 do their job correctly.
365 This action can easily be performed using the command \f(CRxsel -c\fP
366 for example.
367 .TP 2
368 \fBRemark 2.\fP
369 Some X-Windows terminal emulators intercept mouse input
370 when some modifiers are used, a typical example is xterm which displays
371 popup menus in these cases.
373 For xterm (Patch #361 - 2020/10/14 or later) a working workaround
374 is to use the X resource \f(CRXTerm*omitTranslation:popup-menu\fP
375 either by adding it in your \f(CR.Xresources\fP file and register
376 it with \f(CRxrdb\fP or by launching xterm using the
377 \f(CR-xrm 'XTerm*omitTranslation:popup-menu'\fP command line option.
378 .TP 2
379 \fBRemark 3 for BSD systems.\fP
380 In order for the mouse to work properly under (virtualised?) FreeBSD
381 and perhaps other BSD variants, it may be necessary add the following
382 two lines to the file \fB~/.Xmodmap\fP:
385 \f(CR! Disable button 8 and 9.
386 pointer = 1 2 3 4 5 6 7 0 0 10 11 12\fP
389 And run the command: \f(CRxmodmap ~/.Xmodmap\fP
390 (ignore any warnings issued by this command).
392 This can also be done non-permanently by running the command:
394 \f(CRxmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 10 11 12"\fP
397 If this is not enough, try to disable buttons 8 to 12.
401 \fBDirect access:\fP
402 .RS 2
403 If \fB-N\fP|\fB-number\fP, \fB-U\fP|\fB-unnumber\fP or
404 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP are used, then it becomes
405 possible to directly access a word by entering its number.
406 The numbering created using these option is done \fBbefore\fP any words
407 substitution done using \fB-S\fP|\fB-subst\fP \fI/regex/repl/opts\fP,
408 \fB-I\fP|\fB-si\fP|\fB-subst_included\fP or
409 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP.
411 Using a combination of these options, it is easy to control which words
412 will be numbered by adding a special symbol in it before using smenu and
413 removing it (substituted by nothing) afterward using
414 \fB-I\fP|\fB-si\fP|\fB-subst_included\fP by example.
416 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP gives another way to do that,
417 see below or more.
419 .SS "Changing input words"
420 smenu offers the possibility to modify the input words in a sed-like way.
421 Words can be modified at two points: just after they have been read
422 and after other operations have been applied, such as enabling,
423 disabling or coloring.
425 The related options are \fB-ES\fP|\fB-subst\fP,
426 \fB-S\fP|\fB-subst\fP, \fB-I\fP|\fB-si\fP|\fB-subst_included\fP and
427 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP their descriptions can be found
428 in the \fBOPTIONS\fP section.
429 .SS "Searching for words"
430 A word can be searched using different algorithms: \fIprefix\fP,
431 \fIsubstring\fP of \fIfuzzy\fP.
433 \fIprefix\fP (keys \fB^\fP or \fB=\fP):
434 The sequence of characters entered must match the beginning of a word.
436 \fIsubstring\fP (keys \fB"\fP or \fB'\fP):
437 The sequence of characters entered must match a substring in a word.
439 \fIfuzzy\fP (keys \fB~\fP or \fB*\fP):
440 All the characters in the entered sequence must appear in the same order
441 in a word, but need not be consecutive.
443 The case is also ignored.
445 Note that spaces and tabs at the beginning and end of words are ignored
446 when searching for substrings or fuzzy strings.
448 The cursor is placed, if possible, on the first matching word having the
449 minimum number of gaps between the first and last matching character,
450 see the difference between the actions of the \fBs\fP/\fBS\fP and
451 \fBn\fP/\fBN\fP keys below.
453 This method also tolerates intermediate symbols not appearing in the
454 words which will be ignored.
455 If this is the case, the attributes of the approximately matching
456 words are changed into an error versions of them to warn the user to
457 this situation.
459 The erroneous symbols will \fInot\fP be inserted in the search buffer.
461 For example: if the word \fBabcdef\fP is present in the standard input,
462 then entering \f(CBabxcdye\fP puts \fBabcdef\fP in the search buffer
463 and the word is added to the list of matching words and displayed with
464 an error attribute (in red by default).
466 This special state will persist until all the symbols following the first
467 erroneous one are deleted (using backspace) or if \fBESC\fP is pressed
468 to cancel the search session and clear the search buffer.
470 During a search session, the cursor changes and each character entered is
471 added in (or removed from) the search buffer.
472 The display is refreshed after each change in this buffer.
474 A 10 seconds timeout (by default) automatically ends the current
475 search session as if the \fBEnter\fP key had been pressed.
476 This timeout is reset each time a new key is hit in search mode.
477 This delay can be configured using the \fBsearch\fP entry in the
478 \fBtimers\fP section of the configuration file as shown in the example
479 in the configuration subsection.
481 The slash key (\fB/\fP) can also be used instead of any of these keys.
482 By default it is is programmed to do a \fIfuzzy\fP search but this can
483 be changed by using the command line option
484 (\fB-/\fP|\fB-search_method\fP) or by tuning a configuration file,
485 see below.
487 All the words matching the current search buffer are enhanced:
488 The characters present in the current search buffer are highlighted in
489 one way and the other characters in another way.
490 Both of these highlighting methods are configurable.
492 If the user has entered the search sequence: \fBo\fP, \fBs\fP, then the
493 matching word "words" will be displayed as \fBw\fP\fIo\fP\fBrd\fP\fIs\fP
494 when the \fIfuzzy\fP algorithm is in use depending of the display
495 attributes configured.
497 \fBENTER\fP and all cursor moves terminate the search session but do
498 not clear the list of the matching words and the search buffer.
500 The user can then use the \fBn\fP/\fBs\fP/\fBSPACE\fP keys (forward) and
501 the \fBN\fP/\fBS\fP keys (backward) to navigate in the list of matching
502 words,
504 In \fIfuzzy\fP search mode, the \fBs\fP/\fBS\fP keys attempt to move the
505 cursor to the next/previous word whose matching part forms a substring
506 of this word.
507 If no such matches exist, \fBs\fP/\fBS\fP and \fBn\fP/\fBN\fP do the
508 same things.
509 To move the cursor to the next/previous fuzzy match, use the
510 \fBn\fP/\fBN\fP/\fBSPACE\fP keys.
511 \fBs\fP means next \fPs\fPubstring match in this context while \fBn\fP
512 just means \fBn\fPext match.
514 If the user hits the \fBHOME\fP or \fBEND\fP key during a search session
515 then the list of matching words is reduced to the words starting
516 (respectively) ending with the current search pattern and the window
517 is refreshed.
518 For those who consider \fBHOME\fP and \fBEND\fP as non-intuitive,
519 the \fBCTRL\ A\fP and \fBCTRL\ Z\fP keys are also available in search mode
520 as an alternative.
521 This behavior is persistent until the user hit the \fBESC\fP or
522 \fBENTER\fP key.
524 For example, if the search pattern in substring mode is \f(CBsh\fP and
525 the user hits \fBEND\fP, then only the words \fIending\fP with \f(CBsh\fP
526 will be added in the searched word list and enhanced.
528 Note that when a matching word is selected, its enhanced characters only
529 show one of the multiple matching possibilities.
531 When not in a search session \fBESC\fP can be also used to clear the
532 list of matching words and to reset the search buffer.
534 Note that the search buffer is persistent as long as the same search
535 algorithm is used and \fBESC\fP has not been pressed.
536 .SS "Selection and Exit"
537 Pressing \fBq\fP gives the possibility to exit without selecting anything.
539 \fBCTRL\ C\fP (Abort) also exits the program immediately with a return
540 code equal to 128+SINGINT (by default) without selecting anything.
541 See the \fB-!\fP|\fB-int\fP|\fB-int_string\fP option for more information
542 about the customization of the \fBCTRL\ C\fP behavior.
544 By default, \fBENTER\fP or a double click with the first mouse button if
545 applicable writes the selected word to stdout when not in
546 search mode otherwise it exits from this mode and does nothing more.
547 If you want to be able to select a word \fIeven\fP when in search mode,
548 use the \fB-r\fP|\fB-auto_validate\fP option to change this behavior.
549 .SS "Tagging (multiple selections)"
550 When the tagging is activated by using the command line
551 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP
552 or \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP option, then the
553 keys \fBt\fP, \fBu\fP, \fBINS\fP, \fBDEL\fP \fBc\fP, \fBr\fP,
554 \fBm\fP, \fBM\fP, \fBT\fP, \fBC\fP, \fBR\fP and \fBU\fP, can be
555 used to tag/untag some words.
556 These tagged words will then be sent to the standard output when
557 \fBENTER\fP is pressed.
559 Their meanings is as follows:
561 \fBt\fP
562 Tags/untags or Pin/unpin the word under the cursor (toggle).
564 \fBu\fP
565 Untags or unpins the word under the cursor.
567 \fBINS\fP
568 Tags or pins the word under the cursor.
570 \fBDEL\fP
571 Untags or unpins the word under the cursor.
573 \fBc\fP
574 Tags or pins all the selectable words in the current \fBcolumn\fP when
575 no word is marked, otherwise acts like \fBC\fP.
577 \fBr\fP
578 Tags or pins all the selectable words in the current \fBrow/line\fP
579 when no word is marked, otherwise acts like \fBR\fP.
581 \fBm\fP
582 Marks the current word, the cursor aspect will change until the word
583 is unmarked.
585 \fBM\fP or \fBESC\fP
586 Unmarks the current word, other actions will also automatically unmark
587 the word, see below.
589 \fBT\fP
590 If no word are marked and the result of a search is still displayed then
591 tags all words found in this search.
593 If no word has been searched and no word is marked, then the current
594 word is marked, just as if \fBm\fP has been used instead.
595 Otherwise all words between the marked word and the
596 current word are tagged.
598 The marked word will no longer be marked after tagging is complete.
600 \fBZ\fP
601 Like \fBT\fP when not in search mode and when the marked words is not
602 on the same column or line as the cursor in column mode.
604 When in column mode and if the marked word is in the same column or line
605 as the cursor, tags only the words in the same column (respectively line)
606 bounded by the marked word and the cursor.
608 \fBC\fP
609 As for \fBT\fP, \fBC\fP marks the current word if no word is currently
610 marked, just as if \fBm\fP had been used instead.
612 If a word is already marked, \fBC\fP tags/pins the words between the
613 current and the marked words if they are the \fBsame column\fP.
615 The marked word will no longer be marked after tagging is complete.
617 \fBR\fP
618 As for \fBT\fP, \fBR\fP marks the current word if no word is currently
619 marked, just as if \fBm\fP has been used instead.
621 If a word is already marked, \fBR\fP tags/pins the words between the
622 current and the marked words if they are the \fBsame row/line\fP.
624 The marked word will no longer be marked after tagging is complete.
626 Note that when you use \fBT\fP, \fBC\fP or \fBR\fP with pinning enabled,
627 the order of word selection depends on whether the marked word is before
628 or after the current word.
630 When a word is marked, the pinning order using \fBc\fP and \fBr\fP
631 increases from the marked word to the current word.
633 When no words are marked, the pinning order when using \fBc\fP and \fBr\fP
634 always increases from top to bottom and from left to right respectively.
636 \fBU\fP
637 Untags or unpins the last tagging action.
639 \fBCTRL T\fP
640 Untags all the previously tagged/pinned words.
642 The marked word, if any, will no longer be marked after this action.
644 Also note that using some of these keys may be more easily achieved by
645 using the third mouse button (usually the right one) when the mouse
646 is available.
648 See how to use the right mouse buttons in the "Keyboard and mouse
649 usage." at the beginning of this manual.
650 .SS Help
651 A small help message can be displayed when hitting the \fB?\fP key.
652 This message will last for 10s or until another key or \fBESC\fP is
653 pressed.
654 .SS "Scroll bars"
655 The vertical scroll bar is displayed at the right of the scrolling window.
656 Its appearance is meant to be classical but it has some particularities:
657 .IP \(bu 2
658 The vertical scroll bar is not displayed if all the input words fit on
659 only one line.
660 .IP \(bu 2
661 Otherwise, the vertical scroll bar is always displayed except when
662 the \fB-q\fP option is set.
663 This option completely disables the scroll display of all scroll bars.
664 .IP \(bu 2
665 When the scrolling window has only one line, the vertical scroll bar
666 has only 3 states:
667 .RS 2
668 .IP - 2
669 \fBv\fP when on all but the last line, indicating that you can go down
670 to see more.
671 .IP - 2
672 \fB^\fP when on the last line.
673 .IP - 2
674 \fB|\fP otherwise.
676 .IP \(bu 2
677 When there is more than one line to display, \fB/\fP means that the window
678 displays the first line, \fB\\\fP the last line.
679 \fB|\fP is used to fill the gap, see below the different possible
680 configurations.
682 tab(@);
683 l l l l l
684 l l l l l
685 l l l l .
686 \\@\\@^@^@\\ @Do not remove this trailing space!
687 |@|@|@|@/
688 /@v@/@v
691 A \fB+\fP can also appear in the scroll bar in lieu of the vertical bar,
692 giving the relative position of the cursor line in the bunch of input
693 words.
695 The horizontal scroll bar is only displayed below the window when the
696 current line is truncated in line of column mode.
698 If its appearance scrolls up the windows in the screen, the new position
699 of the window will unchanged even it this scroll bar is no more displayed
700 as the line containing the cursor is no more truncated.
701 .SS "Terminal resizing (also see BUGS/LIMITATIONS)"
702 The windows is redrawn if the terminal is resized.
703 The redrawing is actually done only 1s after the end of the resizing to
704 avoid artifacts on screen.
705 The cursor will remain on the current selected word but may be displayed
706 at another place in the window.
707 .SS "Unicode support"
708 This utility is Unicode aware and should be able to display correctly
709 any Unicode character (even double-width ones) as long as the current
710 encoding is \fBUTF-8\fP (\fBUTF-8\fP in the output of the \fIlocale\fP
711 command).
713 Note that smenu will not attempt to normalize words containing UTF-8 glyphs.
714 Thus \fI\\u61\\ucc88\fP (\fIä\fP) will not be considered equal to
715 \fI\\uc3a4\fP (canonical normalization of Â \fIä\fP).
716 It is nevertheless possible to use an external tool such as uconv from the
717 ICU project (https://icu.unicode.org) to do this work before using smenu.
719 For example: uconv can be used as a filter as in:
721 \f(CBcat ... | uconv -x any-nfc | smenu\fP
722 .SS "Optional configuration file"
723 If a file with adequate permissions and the same name as the executable
724 but prefixed with a dot is present in the current directory
725 or in the user's home directory, then it will be parsed as a
726 \fI.ini\fP file.
727 The values read from the file in the home directory will be overridden by
728 the ones read from the local directory (if it is present).
730 Missing and bad keywords are silently skipped.
732 The values read, if valid, override the default hard-coded ones.
734 If a value is invalid an error message is shown and the program terminates.
736 The values of the timers must be given in units of \fB1/10\fP of a second.
738 Here is an example giving the syntax and the names of the keywords
739 allowed:
742 \f(CR--8<------------------------------------------------------------------
743 [colors]
744   ; The terminal must have at least 8 colors and/or have attributes
745   : like bold and reverse for this to be useful
746   ; if not the following settings will be ignored.
748   method=ansi             ; classic | ansi (default)
750   cursor=0/2              ; cursor attributes
751   cursor_on_tag=0/2,u     ; cursor on tag attributes
752   shift=6,b               ; shift symbol attributes
753   message=0/3             ; message (title) attributes
754   bar = 7/4,b             ; scroll bars attributes
755   search_field = 0/6      ; search field attributes
756   search_text = 7,bu      ; search text attributes
757   match_field = 1,b       ; matching words field attributes
758   match_text = 7,bu       ; matching words text attributes
759   search_err_field = 1    ; approximate search field attributes
760   search_err_text = 1,r   ; approximate search text attributes
761   ; match_err_field = 3   ; approximate matching words field attributes
762   match_err_text = 1      ; approximate matching words text attributes
763   ; include = b           ; selectable color attributes
764   exclude = 4/0,u         ; non-selectable color attributes
765   tag = 0/5               ; tagged (selected) attributes
766   daccess = 3,b           ; direct access tag attributes
768   special1 = 7/4,b        ; attributes for the special level 1
769   special2 = bu           ; attributes for the special level 2
770   special3 = /3,b         ; attributes for the special level 3
771   special4 = 7/4          ; attributes for the special level 4
772   special5 = 7/2,b        ; attributes for the special level 5
773   special9 = 2,rb         ; attributes for the special level 9
775 [window]
776   lines = 7               ; default number of lines of the window
778 [limits]
779   word_length = 1024      ; arbitrary max length of input words (int)
780   words = 32767           ; arbitrary max number of allowed input
781                           ; words (int)
782   columns = 128           ; arbitrary max number of columns (int)
784 [timers]
785   search = 100            ; search timeout in 1/10 s
786   help = 150              ; duration of the help message in 1/10 s
787   window = 7              ; delay before redrawing if the size of the
788                           ; terminal's window change in 1/10 s
789   direct_access = 6       ; duration allowed to add a new digit to
790                           ; the direct word access number in 1/10 s
791   forgotten = 9000        ; An explicit delay (in 1/10 s) before smenu
792                           ; is forced to stop as if "q" had been pressed.
793                           ; Useful when one forgot to make a selection.
795 [misc]
796   default_search_method = substring
798 [mouse]
799   double_click_delay= 200 ; delay in milliseconds
800 --8<------------------------------------------------------------------
803 .IP \(bu 2
804 The \fBmethod\fP keyword can take the two possible values displayed
805 above and determines if you want to use the native method (limited to 8
806 colors) of the \fBansi\fP method (ISO 8613-6) if your terminal supports
807 more than 8 colors.
809 The default value corresponds to \fBansi\fP.
811 The attributes syntax is [fg][/bg][[,.+]toggles] where \fBfg\fP and
812 \fBbg\fP are numbers representing the foreground and background color
813 and \fBtoggles\fP is a strings which can contain the characters \fIb\fP,
814 \fId\fP, \fIr\fP, \fIs\fP, \fIu\fP, \fIi\fP, \fIn\fP and \fIl\fP
815 representing respectively \fIb\fPold, \fId\fPim, \fIr\fPeverse,
816 \fIs\fPtandout, \fIu\fPnderline, \fIi\fPtalic, i\fIn\fPvisible
817 and b\fIl\fPink.
818 .IP \(bu 2
819 Spaces are allowed anywhere in the lines and between them, even around
820 the \fB=\fP.
821 .IP \(bu 2
822 Everything following a \fB;\fP is ignored.
823 .IP \(bu 2
824 When undefined, the default limits are:
826 tab(@);
827 l l .
828 words@32767
829 word_length@512
830 columns@256
832 .SH OPTIONS
834 Not all options may be available, depending on the current context.
836 When smenu is called and before the first option is evaluated, it is in
837 the \fBMain\fP context.
838 Each option can switch to another context in which only a subset of the
839 options is usable.
841 For each parameter described below, the contexts in which the associated
842 option is defined as well as the context to which it leads, if any,
843 are given.
845 An option not defined in a context will force the end of the current
846 context and will be recursively evaluated in the previous contexts until
847 found (or not).
848 If not found, an error message is displayed and smenu is terminated.
850 The contexts defined in smenu are:
851 .IP \fBMain\fP 2
852 The default context
853 .IP \fBColumns\fP 2
854 After the \fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP parameter.
855 .IP \fBLines\fP 2
856 After the \fB-l\fP|\fB-line\fP|\fB-line_mode\fP parameter.
857 .IP \fBTabulations 2
858 After the \fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP parameter.
859 .IP \fBTagging\fP 2
860 After the \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP or
861 \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP parameter.
863 .IP \fBWARNING\fP 2
864 Here is a situation that may seem confusing at first glance.
866 Imagine the only parameter command line parameter is \fB-cols_select\fP.
868 Since this is a parameter of an option which is not valid when not in
869 the \fBColumns\fP context, it should have raised an error but it still
870 seems to be accepted.
872 The trick is: when not in column mode \fB-cols_select\fP is indeed not
873 accepted but its prefix (\fB-col\fP) is valid.
874 The options are thus understood as: \fB-col\fP \fB-s_select\fP.
875 The same mechanism occurs again as \fB-s\fP is also valid in column
876 mode so the final understanding of the command line is: \fB-col\fP
877 \fB-s\fP \fB_select\fP.
879 Another example that illustrates the fact that long parameters have
880 priority over short parameter combinations: \fB-is\fP will not select
881 only words containing a "\fBs\fP", but will act in the same way as its
882 alternative name (\fB-incremental_search\fP).
884 If you really want to select only words containing a "\fBs\fP", simply
885 add a space after the \fBi\fP as in \fB-i s\fP or use one of the other
886 \fB-i\fP names such as \fB-inc\fP for example.
888 In such cases, the user may set the \fBCTXOPT_DEBUG\fP environment
889 variable which any non-empty content.
891 If we reconsider the \fB-cols_select\fP example with \fBCTXOPT_DEBUG\fP set
892 the output is now:
895 CTXOPT_DEBUG: Parameter: -cols_select. Evaluation context: Main.
896 CTXOPT_DEBUG: Found a valid parameter as a prefix of -cols_select: -col.
897 CTXOPT_DEBUG: Parameter: -col. Evaluation context: Main.
898 CTXOPT_DEBUG: Switch to context Columns.
899 CTXOPT_DEBUG: Parameter: -s_select. Evaluation context: Columns.
900 CTXOPT_DEBUG: Found a valid parameter as a prefix of -s_select: -s.
901 CTXOPT_DEBUG: Parameter: -s. Evaluation context: Columns.
902 CTXOPT_DEBUG: Argument: _select.
905 In this case, adding a space in the command line: \fB-col\fP
906 \fB-cols_select\fP \fB1\fP also solves the issue and indicates that only
907 the first column should be selectable.
909 Note, however, that at least one argument for \fB-cols_select\fP is
910 now required:
913 CTXOPT_DEBUG: Parameter: -col. Evaluation context: Main.
914 CTXOPT_DEBUG: Switch to context Columns.
915 CTXOPT_DEBUG: Parameter: -cols_select. Evaluation context: Columns.
916 CTXOPT_DEBUG: Argument: 1.
919 The \fB-h\fP|\fB-help\fP and \fB-?\fP|\fB-u\fP|\fB-usage\fP options now
920 display the help and synopsis of the available options in the current
921 context.
922 .IP Example: 2
923 \f(CBsmenu -col -u\fP will only show the usage in the \fBColumns\fP
924 context
926 The contexts contain all the non-context-changing options so, in practice,
927 the usage should be intuitive.
928 You may nevertheless have to adjust some scripts using the old smenu
929 releases as I did in the lvm_menu example.
931 Some of the advantages of this new system of options are:
932 .IP \(bu 2
933 Long parameter names are allowed
934 One dash is enough, but two are also allowed for compatibility reasons.
935 .IP \(bu 2
936 An option can be referenced by any number of parameters with short or
937 long names.
938 .IP \(bu 2
939 Auto checking of missing mandatory options, duplicated option,...
940 .IP \(bu 2
941 Only options usable in the current context are allowed.
943 This option management system is explained in more detail at
944 https://github.com/p-gen/ctxopt.
946 The description of each command line parameter is as follows:
947 .IP "\fB-h\fP|\fB-help\fP"
948 (Allowed in all contexts.)
950 Display a context specific help messages and exits.
951 .IP "\fB-H\fP|\fB-long_help\fP"
952 (Allowed in the "Main" context.)
954 Display a long (non context specific) help messages and exits.
955 .IP "\fB-?\fP|\fB-u\fP|\fB-usage\fP"
956 (Allowed in all contexts.)
958 Displays a short help message and exits.
959 .IP "\fB-V\fP|\fB-version\fP"
960 (Allowed in the "Main" context.)
962 The \fB.smenu\fP files in the user's home directory and in the current
963 directory, if present, will be ignored when this option is used.
964 .IP "\fB-n\fP|\fB-lines\fP|\fB-height\fP [\fIheight\fP]"
965 (Allowed in all contexts.)
967 Gives the maximum number of lines in the scrolling selection window.
969 If \fB-n\fP|\fB-lines\fP|\fB-height\fP is not present the number of
970 lines will be set to \fI5\fP.
972 If \fB-n\fP|\fB-lines\fP|\fB-height\fP is present without argument, then
973 the height of the terminal will be used to determine the number of lines.
974 This remains true even if the terminal is resized.
976 If \fB-n\fP|\fB-lines\fP|\fB-height\fP is present with a numerical
977 argument, this value will be used to determine the number of lines.
978 .IP "\fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP... \fIregex\fP"
979 (Allowed in all contexts.)
981 Sets the \fBi\fPnclude filter to match the selectable words.
982 All the other words will become implicitly non-selectable (excluded)
984 \fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP can be used more
985 than once with cumulative effect.
987 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp.
988 .IP "\fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP... \fIregex\fP"
989 (Allowed in all contexts.)
991 Sets the \fBe\fPxclude filter to match the non-selectable words.
992 All the other selectable words will become implicitly selectable (included)
994 \fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP can be used more
995 than once with cumulative effect.
996 This filter has a higher priority than the include filter.
998 The \fIregex\fP selections made using
999 \fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP and/or
1000 \fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP are done before
1001 the possible words alterations made
1002 by \fB-I\fP|\fB-si\fP|\fB-subst_included\fP or
1003 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP (see below).
1005 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp.
1006 .IP "\fB-m\fP|\fB-msg\fP|\fB-message\fP|\fB-title\fP \fImessage\fP"
1007 (Allowed in all contexts.)
1009 Displays a message (title) above the window.
1010 If the current locale is not \fBUTF-8\fP, then all \fBUTF-8\fP characters
1011 will be replaced by the substitution character.
1013 \fI\\u\fP and \fI\\U\fP sequences can be used in the message.
1015 Note that the message will be truncated if it does not fit on a terminal
1016 line.
1017 .IP "\fB-!\fP|\fB-int\fP|\fB-int_string\fP [\fIstring\fP]"
1018 (Allowed in all contexts.)
1020 The optional \fIstring\fP argument, when present,
1021 defines the string to be used as the selection string when
1022 the \fBCTRL\ C\fP sequence is entered.
1024 If \fIstring\fP is missing then nothing will be selected.
1026 In all cases, when \fB-!\fP|\fB-int\fP|\fB-int_string\fP is present in
1027 the command line, the return code of the program will be \fB0\fP.
1029 This gives the user the choice to make the behavior of \fBCTRL\ C\fP
1030 similar to that of \fBq\fP and \fBQ\fP or to that of the Unix shell
1031 leaving the shell with a return code greater than 128.
1032 .IP "\fB-a\fP|\fB-attr\fP|\fB-attributes\fP \fIprefix:attr\fP..."
1033 (Allowed in all contexts.)
1035 Sets the display attributes of the elements displayed and the cursor.
1037 At least one attribute prefixed attribute must be given.
1039 \fIprefix\fP can take the following values:
1041 .PD 0
1042 .IP \fIi\fP
1043 included words.
1044 .IP \fIe\fP
1045 excluded words.
1046 .IP \fIc\fP
1047 cursor.
1048 .IP \fIb\fP
1049 scroll bar.
1050 .IP \fIs\fP
1051 shift indicator.
1052 .IP \fIm\fP
1053 message (title).
1054 .IP \fIt\fP
1055 tagged words.
1056 .IP \fIct\fP
1057 cursor on tagged words.
1058 .IP \fIsf\fP
1059 search field.
1060 .IP \fIst\fP
1061 search text.
1062 .IP \fIsfe\fP
1063 approximate search field with error.
1064 .IP \fIste\fP
1065 approximate search text with error.
1066 .IP \fImf\fP
1067 matching words field.
1068 .IP \fImt\fP
1069 matching words text.
1070 .IP \fImfe\fP
1071 matching words field with error.
1072 .IP \fImte\fP
1073 matching words text with error.
1074 .IP \fIda\fP
1075 direct access tag.
1079 If more than one attribute is given, they must be separated by spaces.
1081 Example: \f(CB-attr i:/5 e:4,br b:7/3,rb c:7/2,b\fP
1083 See the the \fB-1\fP|\fB-l1\fP|\fB-level1\fP option below for the
1084 description of the attributes syntax after the colon and an example.
1085 .IP "\fB-1\fP|\fB-l1\fP|\fB-level1\fP \fIregex\fP [\fIattr\fP]"
1086 .IP "\fB-2\fP|\fB-l2\fP|\fB-level2\fP \fIregex\fP [\fIattr\fP]"
1087 .IP "\fB-3\fP|\fB-l3\fP|\fB-level3\fP \fIregex\fP [\fIattr\fP]"
1088 .IP "\fB-4\fP|\fB-l4\fP|\fB-level4\fP \fIregex\fP [\fIattr\fP]"
1089 .IP "\fB-5\fP|\fB-l5\fP|\fB-level5\fP \fIregex\fP [\fIattr\fP]"
1090 .IP "\fB-6\fP|\fB-l6\fP|\fB-level6\fP \fIregex\fP [\fIattr\fP]"
1091 .IP "\fB-7\fP|\fB-l7\fP|\fB-level7\fP \fIregex\fP [\fIattr\fP]"
1092 .IP "\fB-8\fP|\fB-l8\fP|\fB-level8\fP \fIregex\fP [\fIattr\fP]"
1093 .IP "\fB-9\fP|\fB-l9\fP|\fB-level9\fP \fIregex\fP [\fIattr\fP]"
1094 (Allowed in all contexts.)
1096 Allows one to give a special display color to up to 5 classes of words
1097 specified by regular expressions.
1098 They are called \fBspecial levels\fP.
1099 Only selectable words will be considered.
1101 By default, the first 5 special levels have their foreground color set
1102 to red, green, brown/yellow, purple and cyan and the remaining 4 levels
1103 are set to white.
1104 All these colors also can be set or modified permanently in the
1105 configuration files.
1106 See the example file above for an example.
1108 The optional second argument (\fIattr\fP) can be used to override the
1109 default or configured attributes of each class.
1110 Its syntax is the same as the one used in the configuration file:
1112 [\fIfg\fP][/\fIbg\fP]\
1113 [,{\fIb\fP|\fId\fP|\fIr\fP|\fIs\fP|\fIu\fP|\fIi\fP|\fIn\fP|\fIl\fP}] \
1114 | [{\fIb\fP|\fId\fP|\fIr\fP|\fIs\fP|\fIu\fP|\fIi\fP|\fIn\fP|\fIl\fP}]
1117 Examples of possible attributes are:
1119   \f(CB2/0,bu \fPgreen on black bold underline
1120   \f(CB/2     \fPgreen background
1121   \f(CB5      \fPtext in purple
1122   \f(CBrb     \fPreverse bold
1125 \fI\\u\fP and \fI\\U\fP sequences can be used in the pattern.
1126 .IP "\fB-z\fP|\fB-zap\fP|\fB-zap_glyphs\fP \fIbytes\fP"
1127 (Allowed in all contexts.)
1129 Initializes a set of \fBUTF-8\fP characters to be ignored when reading
1130 words from stdin or a file.
1132 Example: The argument \f(CR'\\u0d\\ue282ac,'\fP means: ignore all commas,
1133 Euro signs and carriage return characters when reading from stdin or
1134 a file.
1136 As shown above \fI\\u\fP and \fI\\U\fP sequences can be used in the
1137 bytes set.
1138 .IP "\fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP [\fIdelim\fP]"
1139 (Allowed in the following contexts: "Main", "Columns", "Lines", and
1140 "Tabulations", switches to the "Tagging" context.)
1142 Allows multiple selections and switches to \fBtag\fP mode.
1143 In this mode, several selectable words can be selected without leaving
1144 the program.
1146 Tagged words are highlighted (underlined by default).
1148 The current word can be automatically tagged when the \fBENTER\fP key
1149 is pressed to complete the selection process if the
1150 \fB-p\fP|\fB-at\fP|\fB-auto_tag\fP option is
1151 also set or if no word has been tagged.
1153 Note that nothing is selected when no word is tagged and when the
1154 \fB-0\fP|\fB-noat\fP|\fB-no_auto_tag\fP option is also set.
1156 All tagged words (and possibly the world under the cursor) will be sent
1157 to the standard output separated by the optional argument given after
1158 the option \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP.
1160 Note that the \fIdelim\fP argument can contain more than one character,
1161 can contain \fBUTF-8\fP characters (in native or \fI\\u\fP or \fI\\U\fP
1162 form) and can even contain control character as in \f(CB$'\\n'\fP.
1164 A single space character is used as the default separator if none
1165 is given.
1167 \fBCaution\fP: To get exactly the same behavior as in version 0.9.11
1168 and earlier, you must also use the \fB-p\fP|\fB-at\fP|\fB-auto_tag\fP
1169 option.
1170 .IP "\fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP [\fIdelim\fP]"
1171 (Allowed in the following contexts: "Main", "Columns", "Lines", and
1172 "Tabulations", switches to the "Tagging" context.)
1174 Works like \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP but, unlike
1175 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP, the output depends on
1176 the order in which the words were tagged.
1177 In other words, the first tagged word comes first in the output, the
1178 second tagged word comes next, and so on.
1179 .IP "\fB-p\fP|\fB-at\fP|\fB-auto_tag\fP"
1180 (Allowed in the "Tagging" context.)
1182 This option modifies the default behavior of the
1183 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP
1184 and \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP options.
1186 An untagged word under the cursor will be automatically tagged when
1187 \fBENTER\fP is pressed.
1188 .IP "\fB-0\fP|\fB-noat\fP|\fB-no_auto_tag\fP"
1189 (Allowed in the "Tagging" context.)
1191 This option modifies the default behavior of the
1192 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP
1193 and \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP options.
1195 An untagged word under the cursor will \fBnot\fP be automatically tagged
1196 when \fBENTER\fP is pressed \fBand\fP no other words are tagged.
1197 This is true even when the option \fB-p\fP|\fB-at\fP|\fB-auto_tag\fP is
1198 also set.
1200 It is ignored if at least one other word is tagged at that time.
1201 .IP "\fB-N\fP|\fB-number\fP>da_ctx... [\fIregex\fP]"
1202 (Allowed in the following contexts: "Main", "Columns", "Lines" and
1203 "Tabulation".)
1205 This option allows you to number selectable words that match a specific
1206 regular expression.
1207 These numbers are numbered from 1 and allow direct access to the words.
1209 To use this functionality, the user must enter the number which
1210 corresponds to the desired entry digit per digit.
1212 Each new digit must be added in a time frame of 1/2 seconds (per default)
1213 otherwise the number is considered complete and a newly entered digit
1214 will start a new number.
1215 If the number does not exists, then the cursor is restored to it's
1216 initial position.
1218 The sub-options of the \fB-D\fP|\fB-data\fP|\fB-options\fP option
1219 described below can change the way \fB-N\fP|\fB-number\fP sets and
1220 formats the numbers.
1222 This option accepts more than one argument and can be used multiple
1223 times with cumulative effects.
1225 \fB-N\fP|\fB-number\fP, \fB-U\fP|\fB-unnumber\fP and
1226 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP can be mixed.
1227 .IP "\fB-U\fP|\fB-unnumber\fP>da_ctx... [\fIregex\fP]"
1228 (Allowed in the following contexts: "Main", "Columns", "Lines" and
1229 "Tabulation".)
1231 This option allows one to unnumber words.
1232 If placed after a previous \fB-N\fP|\fB-number\fP, it can be used to
1233 remove the numbering of selected words.
1234 If placed before, the word which doesn't match its regular expression
1235 will be numbered by default.
1237 This mechanism is similar to to the inclusion/exclusion of words by
1238 \fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP and
1239 \fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP.
1241 This option accepts more than one argument and can be used multiple
1242 times with cumulative effects.
1244 \fB-U\fP|\fB-unnumber\fP, \fB-N\fP|\fB-number\fP and
1245 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP can be mixed.
1246 .IP "\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP"
1247 (Allowed in the following contexts: "Main", "Columns", "Lines" and
1248 "Tabulation".)
1250 This option is similar to \fB-N\fP|\fB-number\fP but does not generate
1251 a continuous flow of numbers but extracts them from the word itself.
1253 With this option you can take full control of the numbering of the
1254 displayed word.
1255 Note that the numbering does not need to be ordered.
1257 The resulting word after the extraction of the number must be non empty.
1259 Some sub-option are required, see the \fB-D\fP|\fB-data\fP|\fB-options\fP
1260 option described below.
1262 \fBNotice\fP that for this option to work correctly, all the embedded
1263 numbers must have the same number of digits.
1264 To get that, a preprocessing may be necessary on the words before using
1265 this program.
1267 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \fB-N\fP|\fB-number\fP and
1268 \fB-U\fP|\fB-unnumber\fP can be mixed.
1269 .IP "\fB-D\fP|\fB-data\fP|\fB-options\fP [\fIparameter\fP...]"
1270 (Allowed in the Following contexts: "Main", "Columns", "Lines" and
1271 "Tabulations".)
1273 This option allows one to change the default behavior of
1274 the \fB-N\fP|\fB-number\fP, \fB-U\fP|\fB-unnumber\fP and
1275 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP options.
1277 Its optional parameters are called sub-options and must respect the
1278 format \fBx\fP:\fBy\fP where \fBx\fP can be:
1281 \f(CBl\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1282 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1283 Here \fBy\fP is the \fBUTF-8\fP character (in native or \fI\\u\fP or
1284 \fI\\U\fP form) to print before the number.
1285 The default is a single space.
1287 Example:
1289 \f(CRecho test | smenu -N -D l:\\(\fP
1291 Will display: '\f(CB(1)\f(CR test\fR'
1294 \f(CBr\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1295 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1296 Here \fBy\fP is the \fBUTF-8\fP character (in native or \fI\\u\fP or
1297 \fI\\U\fP form) to print after the number.
1298 The default is \f(CB)\fP.
1300 Example:
1302 \f(CRecho test | smenu -N -D r:\\>\fP
1304 Will display: ' \f(CB1>\f(CR test\fR'
1307 \f(CBa\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1308 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1309 Here \fBy\fP is '\f(CBleft\fP' (or one of its prefixes) if the number
1310 must be \fIleft\fP aligned, or '\f(CBright\fP' (or one of its prefixes)
1311 if it must be \fIright\fP aligned.
1312 The default is \f(CBright\fP.
1314 Example:
1316 \f(CRecho test | smenu -N -D a:right w:3\fP
1318 Will display: '   \f(CB1)\f(CR test\fR'
1320 \f(CRecho test | smenu -N -D a:left w:3\fP
1322 Will display: ' \f(CB1  )\f(CR test\fR'
1325 \f(CBp\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1326 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1327 Here \fBy\fP is '\f(CBincluded\fP' or '\f(CBall\fP' for the initial
1328 \fIp\fPadding of the non numbered words.
1329 The keyword '\f(CBincluded\fP' means that only \fIincluded\fP word will
1330 be padded while '\f(CBall\fP' means pad \fIall\fP words.
1332 This sub-option may improve compactness when there is a lot of
1333 non-selectable words.
1335 The default is \f(CBall\fP. These keywords can be abbreviated.
1337 \fBWARNING\fP: in column/line/tab mode this sub-option is ignored and
1338 non numbered words are always padded.
1340 Example:
1342 \f(CRecho a b c | smenu -eb -N -D l:\\( p:a\fP
1344 Will display:
1345 \f(CB(1)\f(CR a     b \f(CB(2) c\fR
1348 \f(CRecho a b c | smenu -eb -N -D l:\\( p:i\fP
1350 Will display:
1351 \f(CB(1)\f(CR a b \f(CB(2) c\fR
1354 \f(CBw\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1355 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1356 Here \fBy\fP is the \fIw\fPidth of the number between 1 and 5 included.
1358 For an example, refer to the sub-option \fBa\fP above.
1361 \f(CBf\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1362 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1363 Here \fBy\fP controls if the numbering must \fIf\fPollow the last
1364 extracted number (defaults to \f(CByes\fP) or if it must remain
1365 independent.
1367 The possible values are \f(CByes\fP and \f(CBno\fP but can be abbreviated.
1369 Example:
1371 \f(CRecho 2a b c | smenu -F -D l:\\( f:n n:1 -N\fP
1373 Will display:
1374 \f(CB(2)\f(CR a \f(CB(1)\f(CR b \f(CB(2)\f(CR c\fR
1377 \f(CRecho 2a b c | smenu -F -D l:\\( f:y n:1 -N\fP
1379 Will display:
1380 \f(CB(2)\f(CR a \f(CB(3)\f(CR b \f(CB(4)\f(CR c\fR
1383 \f(CBm\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1384 Here \fBy\fP controls if the numbering of word with missing embedded numbers
1385 must be done or not (defaults to \f(CByes\fP).
1387 When this sub-option is set to \f(CBno\fP, the \f(CBs\fP and \f(CBf\fP
1388 sub-options are ignored.
1390 The possible values are \f(CByes\fP and \f(CBno\fP but can be abbreviated.
1392 Example:
1394 \f(CRecho 2a b c | smenu -F -D l:\\( n:1 m:n -N\fP
1396 Will display:
1397 \f(CB(2)\f(CR a     b     c\fR
1399 \f(CRecho 2a b c | smenu -F -D l:\\( n:1 m:y -N\fP
1401 Will display:
1402 \f(CB(2)\f(CR a \f(CB(3)\f(CR b \f(CB(4)\f(CR c\fR
1404 \f(CBh\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1405 Tells what to do with the characters present before the embedded number if
1406 any.
1408 The allowed directives are: '\f(CBtrim\fP' which discards them if they
1409 form an empty word (only made of spaces and tabulations), '\f(CBcut\fP'
1410 which unconditionally discards them and '\f(CBkeep\fP' which places them
1411 at the beginning of the resulting word.
1413 The default value for this directive is '\f(CBkeep\fP', these keywords
1414 can be abbreviated.
1416 Example:
1418 \f(CBecho \\" 2x\\" | smenu -F -D l:\\( o:1 n:1\fR
1420 Will display:
1422 \f(CB(2)\f(CR  x\fR
1423 \f(CR    ^^\fR
1424 \f(CB    \fRSelection cursor
1426 \f(CBecho \\" 2x\\" | smenu -F -D l:\\( o:1 n:1 h:t\fR
1428 Will display:
1430 \f(CB(2)\f(CR x\fR
1431 \f(CR    ^\fR
1432 \f(CB    \fRSelection cursor
1434 \f(CBecho \\"x2y\\" | smenu -F -D l:\\( o:1 n:1 h:c\fR
1436 Will display:
1438 \f(CB(2)\f(CR y\fR
1441 \f(CBo\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1442 Here \fBy\fP is the \fIo\fPffset of the first multibyte character of
1443 the number to extract from the word (defaults to \f(CB0\fP).
1445 If this offset if immediately followed by the character '\f(CB+\fP',
1446 then the parser will look for the first number (if any) after the given
1447 offset instead of using its absolute value to extract the number.
1449 Note that when the '\f(CB+\fP' is used, it is necessary that the length
1450 of all the numbers to extract have the same size as the algorithm looks
1451 for a digit to identify the beginning of the number to extract.
1452 Hence, for example, \fB1\fP should appear as \fB01\fP in the input is
1453 \f(CBn\fP is set to \f(CB2\fP.
1455 Example:
1457 \f(CBecho x2y xx3y | smenu -F -D l:\\( o:1+ n:1\fR
1459 will display:
1461 \f(CB(2)\f(CR xy \f(CB(3)\f(CR xxy\fR
1463 \f(CBecho x2y xx3y | smenu -F -D l:\\( o:1 n:1\fR
1465 will display (note the absence of the '\f(CB+\fP' character):
1467 \f(CB(2)\f(CR xy     xx3y\fR
1470 \f(CBn\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1471 Here \fBy\fP is the \fIn\fPumber of multibyte characters to extract
1472 from the word starting at the offset given by the \f(CBo\fP sub-option.
1474 Example: \f(CRn:2\fP will extract and use the first 2 digits of each
1475 words from the input stream to number them.
1478 \f(CBi\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1479 Here \fBy\fP is number of multibyte characters to \fIi\fPgnore after
1480 the extracted number
1483 \f(CBd\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1484 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1485 Here \fBy\fP is a multibyte separator.
1486 When present, this directive instructs smenu to output the selected
1487 numbered word(s) \fIprefixed\fP by its(their) direct access number(s)
1488 and the given separator.
1490 Only the numbered word(s) will be prefixed.
1492 \f(CBd\fP stands for \fBd\fPecorate.
1494 This directive can be useful when you want to post-process the output
1495 according to its direct access number.
1497 Example:
1499 \f(CBR=$(echo a b c | smenu -N -D d:-)\fR
1501 will display:
1503 \f(CB1)\f(CR a  \f(CB2)\f(CR b  \f(CB3)\f(CR c\fR
1505 The variable \f(CBR\fP will then contain the string \f(CB2-b\fP if
1506 \f(CBb\fP is selected.
1509 \f(CBs\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1510 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1511 Here \fBy\fP is the direct access number that will be set for the first
1512 numbered word.
1513 Its value is \fB1\fP by default, a value of \fB0\fP is possible.
1515 Example:
1517 \f(CBecho a b c | smenu -N -D s:1000\fR
1519 will display:
1521 \f(CB1000)\f(CR a  \f(CB1001)\f(CR b  \f(CB1002) c\fR
1523 To number all words with the default parameters, use the
1524 syntax: "\f(CR-N\fP" which is a shortcut for:
1525 "\f(CR-N -D l:' ' r:')' a:r p:a\fP"
1527 When the \f(CBw\fP sub-option is not given, the width of the numbers is
1528 determined automatically but if \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP
1529 is set and the value of the \f(CBn\fP sub-option is given then this
1530 value is used.
1532 .IP "\fB-b\fP|\fB-blank\fP"
1533 (Allowed in all contexts.)
1535 Replaces all non-printable characters by a blank.
1536 If this results in a blank word, it will be potentially deleted.
1537 .IP "\fB-.\fP|\fB-dot\fP|\fB-invalid\fP"
1538 (Allowed in all contexts.)
1540 Sets the substitution character for non-printable characters.
1541 When this parameter is not used, the default substitution character is
1542 a single dot.
1543 .IP "\fB-M\fP|\fB-middle\fP|\fB-center\fP"
1544 (Allowed in all contexts.)
1546 Centers the display if possible.
1547 .IP "\fB-d\fP|\fB-restore\fP|\fB-delete\fP|\fB-clean\fP|\fB-delete_window\fP|\
1548 \fB-clean_window\fP"
1549 (Allowed in all contexts.)
1551 Tells the program to clean up the display before quitting by removing
1552 the selection window after use as if it was never displayed.
1553 .IP "\fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP"
1554 (Allowed in the "Main" and "Tagging" contexts, switches to the "Columns"
1555 context.)
1557 Sets the column mode.
1558 In this mode the lines of words do not wrap when the right border of
1559 the terminal is reached but only when a special character is read.
1560 Some words will not be displayed without an horizontal scrolling.
1562 If such a scrolling is needed, some indications may appear on the left
1563 and right edge of the window to help the user to reach the unseen words.
1565 In this mode, the width of each column is minimal to keep the maximum
1566 information visible on the terminal.
1567 .IP "\fB-l\fP|\fB-line\fP|\fB-line_mode\fP"
1568 (Allowed in the "Main" and "Tagging" contexts, switches to the "Lines"
1569 context.)
1571 Sets the line mode.
1572 This mode is the same as column mode but without any column alignment.
1573 .IP "\fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP [\fIcols\fP]"
1574 (Allowed in the "Main" and "Tagging" contexts, switches to the
1575 "Tabulations" context.)
1577 This option sets the tabulation mode and, if a number is specified,
1578 attempts to set the number of displayed columns to that number.
1580 In this mode, embedded line separators are ignored if not explicitly set
1581 with \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP.
1582 The options \fB-A\fP|\fB-fc\fP|\fB-first_column\fP and
1583 \fB-Z\fP|\fB-lc\fP|\fB-last_column\fP can nevertheless be used to
1584 force words to appear in the first (respectively last) position of the
1585 displayed line.
1588 Note that the number of requested columns will be automatically reduced
1589 if a word does not fit in the calculated column size.
1591 In this mode each column has the same width.
1593 .IP "\fB-w\fP|\fB-wide\fP|\fB-wide_mode\fP"
1594 (Allowed in the "Columns" and "Tabulations" contexts.)
1596 When \fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP is followed
1597 by a number of columns, the default is to compact the columns so that they
1598 use the less terminal width as possible.
1599 This option enlarges the columns in order to use the whole terminal width.
1601 When in column mode, \fB-w\fP|\fB-wide\fP|\fB-wide_mode\fP can be used
1602 to force all the columns to have the same size (the largest one).
1603 See option \fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP below.
1606 Note that the column's size is only calculated once when the words are
1607 displayed for the first time.
1608 A terminal resize will not update this value.
1609 This choice enables a faster display.
1612 .IP "\fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP... \
1613 [\fIi\fP|\fII\fP|\fIe\fP|\fIE\fP|\
1614 \fIl\fP|\fIL\fP|\fIr\fP|\fIR\fP|\fIc\fP|\fIC\fP|\
1615 \fIa\fP|\fIA\fP]\
1616 [\fIselectors\fP]..."
1617 (Allowed in the "Columns" context.)
1619 In column mode, this option is useful for performing specific actions
1620 on a set of columns.
1622 These actions varies according to the directive given:
1624 - You can include (directive \fIi\fP or \fII\fP) or exclude (\fIe\fP or
1625 \fIE\fP) a set of selectable columns.
1627 - You can specified the kind of alignment (left, right or center) of the
1628 set of columns with the directives \fIl\fP, \fIL\fP, \fIr\fP, \fIR\fP,
1629 \fIc\fP or \fIC\fP.
1631 - You can also specified the attributes (colors...) of the set of columns
1632 with the directives \fIa\fP or \fIA\fP.
1634 When the directive is missing, the "include" directive is assumed
1635 (\fIi\fP).
1637 Note that it is best to use the lower case version of these directives,
1638 as their upper case alternative may have other meanings in the future.
1640 In selectors, columns can be designated by their number (starting with
1641 1) or by regular expressions surrounded by delimiters consisting of
1642 any printable ASCII character, except spaces and unprotected commas;
1643 commas can be protected by backslashes ('\fCD\\\fP')).
1645 Column ranges are defined  by separating their numbers with a dash. Open
1646 interval to the left or right are allowed, so these interval descriptions
1647 may be preceded or followed by a dash (e.g. \f(CB5-7\fP, \f(CB-2\fP
1648 or \f(CB8-\fP are allowed).
1650 \fBWARNING\fP: ranges of regular expressions are not yest supported.
1652 When using the \fIa\fP|\fIA\fP directive, an attribute \fBmust\fP be
1653 appended prefixed by a colon (':') as in \f(CB-C a1-2:6+b\fP per example.
1654 Refer to the attribute option (\fB-a\fP|\fB-attr\fP|\fB-attributes\fP)
1655 for more details.
1657 Multiple selectors can be regrouped in one argument using commas to
1658 separate them.
1660 This option also accepts multiple arguments, each of them being a
1661 selector.
1663 A selection by regular expressions means that a column containing a word
1664 matching any of these expressions will be included or excluded depending
1665 on the letter given after the option or before the selector if there is
1666 more than one argument.
1668 Regular expressions and column numbers can be freely mixed.
1670 This option also sets the default alignment of column contents when no
1671 arguments are provided.
1672 For example: \f(CB-Cr -Cl1\fP sets the default alignment to the right
1673 and the alignment of the contents of column 1 to the left.
1674 At the beginning, no default alignment of the column contents is set.
1676 Regular expression in \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1677 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP can contain \fBUTF-8\fP
1678 characters either directly or by using the \fI\\u\fP or \fI\\U\fP notation.
1680 Example of columns selection: \f(CB-Ci2,3,/X./,5-7\fP forces the cursor
1681 to only navigate in columns \fB2\fP,\fB3\fP,\fB5\fP,\fB6\fP and \fB7\fP
1682 and those containing a two characters word starting with '\fBX\fP'.
1683 If \fIe\fP was used in place of \fIi\fP, all the columns would have been
1684 selected \fBexcept\fP the columns \fB2\fP,\fB3\fP,\fB5\fP,\fB6\fP,\fB7\fP
1685 and those matching the extended regular expression '\f(CBX.\fP'.
1687 Example of defining the attributes of a column set:
1688 \f(CB-C a2-6:7/4+b\fP forces the columns from 2 to 6 to be bold and have
1689 a foreground color equal to 7 and a background color equal to 4.
1691 Example of mixing alignment and inclusion/exclusion directives:
1692 \f(CB-Ci1-5 -Ce/a+/ -Cr7,/b+/\fP makes columns 1 to 5 selectable, makes
1693 columns whose content starts with "a" non selectable and aligns the
1694 content of the column 7 to the left.
1696 Spaces are allowed in the selection string if they are protected.
1698 When an alignment directive is used and without any column selection,
1699 then the specified alignment becomes the default one, E.g: \f(CB-Cr\fP
1700 sets alignment the default one to the right.
1702 Other example where multiple selectors are used as multiple arguments:
1703 \f(CBps | smenu -col -cols e/TTY/ e/CMD/ e3\fP
1705 \fBWarning\fP, if this option appears on the command line before any
1706 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP option, the specified
1707 column alignments will be protected from any future row alignment
1708 directives.
1709 Otherwise row alignment directives will take precedence. For example:
1711 \f(CBecho "a b c\\\\naa bb cc\\\\naaaa bbbb cccc"
1712 | smenu -c -g\\| -C c2 -R r2\fP
1715 Gives:
1716 \f(CRa   | b  |c\fP
1717 \f(CR  aa| bb |  cc <-- \fPCol. 2 remains centered as \f(CB-C\fP was used first.
1718 \f(CRaaaa|bbbb|cccc\fP
1722 \f(CBecho "a b c\\\\naa bb cc\\\\naaaa bbbb cccc"
1723 | smenu -c -g\\| -R r2 -C c2\fP
1726 Gives:
1727 \f(CRa   | b  |c\fP
1728 \f(CR  aa|  bb|  cc <-- -R\fP takes precedence as it was used first.
1729 \f(CRaaaa|bbbb|cccc\fP
1731 .IP "\fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP... \fIselectors\fP..."
1732 (Allowed in the "Columns" and "Lines" contexts.)
1734 Similar to \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP but for
1735 the rows.
1737 \fBWarning\fP, the directives \fIl\fP, \fIL\fP, \fIr\fP, \fIR\fP, \fIc\fP
1738 and \fIC\fP are only allowed in column mode.
1740 \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1741 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP can be used more than
1742 once in a cumulative manner:
1744 The selection mode (selection or de-selection) is given by the first
1745 occurrence of the options, the other occurrences will only update the
1746 selected or de-selected ranges.
1748 Once a column or a row has been excluded, it cannot be re-included.
1749 .IP "\fB-al\fP|\fBalign\fP... \fIregex_selectors\fP..."
1750 (Allowed in the "Columns" context.)
1752 This option is similar to
1753 \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1754 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP but allows to
1755 align all words matched by on of the regular expression defined in
1756 \fIregex_selectors\fP
1758 This option only accepts a list of regular expressions.
1760 E.g.: \f(CB-al c/a+/,/b+/\fP
1762 \fB-al\fP|\fBalign\fP,
1763 \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1764 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP can be used more than
1765 once in a cumulative manner.
1767 Word alignments with this option take precedence over row and column
1768 alignments.
1769 .IP "\fB-A\fP|\fB-fc\fP|\fB-first_column\fP \fIregex\fP"
1770 (Allowed in the following contexts: "Columns", "Lines" and "Tabulations".)
1772 In column mode, forces all words matching the given regular expression
1773 to be the first one in the displayed line.
1774 If you want to only rely on this method to build the lines, just specify
1775 an empty \fBregex\fP to set the end-of-line separator with
1776 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP '')
1779 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp after
1780 \fB-A\fP|\fB-fc\fP|\fB-first_column\fP.
1782 .IP "\fB-Z\fP|\fB-lc\fP|\fB-last_column\fP \fIregex\fP"
1783 (Allowed in the following contexts: "Columns", "Lines" and "Tabulations".)
1785 Similar to \fB-A\fP|\fB-fc\fP|\fB-first_column\fP but forces the word
1786 to be the latest of its line.
1787 The same trick with
1788 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP
1789 can also be used.
1792 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp after
1793 \fB-Z\fP|\fB-lc\fP|\fB-last_column\fP.
1795 .IP "\fB-g\fP|\fB-gutter\fP [\fIstring\fP]"
1796 (Allowed in the "Columns" and "Tabulations" contexts.)
1798 Replaces the blank after each words in column or tabular mode by a column
1799 separator.
1801 This separator is extracted from the \fIstring\fP argument and each
1802 of its (multibyte) character is used one after the other to fill
1803 the gutter.
1805 If there are more columns that gutter characters then the last character
1806 is used for the remaining columns.
1808 When not given, the separator defaults to a vertical bar \fI|\fP (or a
1809 full height vertical bar if the locale is set to \fBUTF-8\fP).
1811 Each character can be given in normal or \fI\\u\fP or \fI\\U\fP form in
1812 the \fIstring\fP argument.
1814 Example: "\f(CB|- \fP" will allow one to separate the first two columns
1815 with '\f(CB|\fP', then '\f(CB-\fP' will be used and '\f(CB \fP' will
1816 separate the remaining columns if any.
1817 .IP "\fB-k\fP|\fB-ks\fP|\fB-keep_spaces\fP"
1818 (Allowed in all contexts.)
1820 By default, the spaces surrounding the output string will be deleted.
1821 This option forces them to be retained.
1822 .IP "\fB-W\fP|\fB-ws\fP|\fB-wd\fP|\fB-word_delimiters\fP|\
1823 \fB-word_separators\fP \fIbytes\fP"
1824 (Allowed in all contexts.)
1826 This option can be used to specify the characters (or multibyte
1827 sequences) which will be used to delimit the input words.
1829 Each character or multibyte sequence in the given argument will be
1830 understood as a word delimiter.
1832 Multibyte sequences (\fBUTF-8\fP) can be natives of using the same ASCII
1833 representation used in words (a leading \fI\\u\fP or \fI\\U\fP following
1834 by up to 8 hexadecimal characters for the former and 6 hexadecimal
1835 characters for the latter).
1837 Non-printable characters in arguments should be given using the standard
1838 \fI$''\fP representation.
1839 \fI$'\\t'\fP stands for the tabulation character for example.
1841 The default delimiters are: \fISPACE\fP, \fI$'\\t'\fP and \fI$'\\n'\fP.
1842 .IP "\fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\
1843 \fB-line_separators\fP \fIbytes\fP"
1844 (Allowed in all contexts.)
1846 This option can be used to specify the characters (or multibyte
1847 sequences) which will be used to delimit the lines in the input stream.
1849 Each character or multibyte sequence in the given argument will be
1850 understood as a line delimiter.
1852 Multibyte sequences (\fBUTF-8\fP) can be natives of using the same ASCII
1853 representation used in words (a leading \fI\\u\fP or \fI\\U\fP following
1854 by up to 8 hexadecimal characters for the former and 6 hexadecimal
1855 characters for the latter).
1857 Non-printable characters in arguments should be given using the standard
1858 $'' representation.
1859 $'\\n' stands for the newline character for example.
1861 The default delimiter is: \fI$'\\n'\fP.
1863 This option is only useful when the
1864 \fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP or \fB-l\fP option is
1865 also set.
1867 The characters (or multibyte sequences) passed to
1868 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP are
1869 automatically added to the list of word delimiters as if
1870 \fB-W\fP|\fB-ws\fP|\fB-wd\fP|\fB-word_delimiters\fP|\fB-word_separators\fP was
1871 also used.
1873 \fI\\u\fP and \fI\\U\fP sequences can also be used here.
1875 .IP "\fB-q\fP|\fB-no_bar\fP|\fB-no_scroll_bar\fP"
1876 (Allowed in all contexts.)
1878 Prevents the display of the lateral scroll bar.
1879 This also prevents the display of the horizontal scroll bar.
1880 .IP "\fB-no_hbar\fP|\fB-no_hor_scroll_bar\fP"
1881 (Allowed in all contexts.)
1883 Prevents the display of the horizontal scroll bar.
1884 .IP "\fB-S\fP|\fB-subst\fP... \
1885 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1886 (Allowed in all contexts.)
1888 Post-processes the words by applying a regular expression based
1889 substitution.
1890 The argument must be formatted as in the \fBsed\fP editor.
1892 As in \fBsed\fP, matching groups and references to these groups
1893 (from \f(CB\\0\fP to \f(CB\\9\fP in \fIrepl\fP) are supported.
1894 These groups must be surrounded by \f(CB(\fP and \f(CB)\fP in \fIregex\fP.
1895 \f(CB\\0\fP and \f(CB&\fP are equivalent in \fIrepl\fP as in the GNU
1896 version of \fBsed\fP.
1898 Back reference example:
1901 \f(CBR=$(echo "[A] [B] [C]" | ./smenu -S '/([^][]+)/:\\1:/')\fP
1902 will display \f(CR"[:A:] [:B:] [:C:]"\fP
1905 This option can be used more than once.
1906 Each substitution will be applied in sequence on each word.
1907 This sequence can be stopped if a \fBstop\fP flag is encountered.
1910 \fBflags:\fP
1911 .IP \(bu 2
1912 The optional trailing \fBg\fP (for \fIg\fPlobal) means that all matching
1913 occurrences shall be replaced and not only the first one.
1914 .IP \(bu 2
1915 The optional trailing \fBv\fP (for \fIv\fPisual) means that the altered
1916 words will only be used for display and search.
1917 The modifications will \fInot\fP be reflected in the returned word.
1918 .IP \(bu 2
1919 The optional trailing \fBs\fP (for \fIs\fPtop) means that no
1920 more substitution will be allowed on this word even if another
1921 \fB-S\fP|\fB-subst\fP is used.
1922 .IP \(bu 2
1923 The optional trailing \fBi\fP (for \fIi\fPgnore case) means that the
1924 string search operation should ignore the case for this pattern.
1926 Small examples to explain the meaning of \fIv\fP:
1929 \f(CBR=$(echo a b c | smenu -S /b/B/)\fP
1931 will display \f(CR"a B c"\fP and \f(CBR\fP will contain \fIB\fP
1932 when \fIB\fP is selected meanwhile
1935 \f(CBR=$(echo a b c | smenu -S /b/B/\fBv\fP)\fR
1937 will display the same as above but \f(CBR\fP will contain the original
1938 word \fIb\fP when \fIB\fP is selected.
1940 In both cases, only the word \fIB\fP will be searchable and not \fIb\fP.
1942 .IP "\fB-I\fP|\fB-si\fP|\fB-subst_included\fP... \
1943 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1944 (Allowed in all contexts.)
1946 Post-processes the \fBselectable\fP words by applying a regular
1947 expression based substitution (see \fB-S\fP|\fB-subst\fP for details).
1948 .IP "\fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP... \
1949 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1950 (Allowed in all contexts.)
1952 Post-processes the \fBexcluded\fP (or \fBnon-selectable\fP)
1953 words by applying a regular expression based substitution (see
1954 \fB-S\fP|\fB-subst\fP for details).
1957 The \fB/\fP separator that \fB-I\fP|\fB-si\fP|\fB-subst_included\fP and
1958 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP are using above can be
1959 substituted by any other character except \fISPACE\fP, \fI\\t\fP,
1960 \fI\\f\fP, \fI\\n\fP, \fI\\r\fP and \fI\\v\fP.
1962 In the three previous options, \fIregex\fP is a \fBPOSIX\fP
1963 \fBE\fPxtended \fBR\fPegular \fBE\fPxpression.
1964 For details, please refer to the \fBregex(7)\fP manual page.
1966 Additionally \fI\\u\fP and \fI\\U\fP sequences can also be used in
1967 the regexp.
1970 If a post-processing action
1971 (\fB-S\fP|\fB-subst\fP, \fB-I\fP|\fB-si\fP|\fB-subst_included\fP, \
1972 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP) results in an empty (length = 0)
1973 word, then we have two cases:
1975 .IP "in column mode:"
1976 Substitutions involving empty words can lead to misalignments, so it is
1977 necessary to prohibit them and terminate the program.
1978 These substitutions have to be made with other tools before using this
1979 utility.
1980 .IP "otherwise:"
1981 The word is simply removed.
1983 .IP "\fB-ES\fP|\fB-subst\fP... \
1984 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1985 (Allowed in all contexts.)
1987 Pre-processes words by applying a substitution based on a regular expression.
1988 The argument must be formatted as in the \fBsed\fP editor.
1990 The substitutions are made, as the name of the option indicates, before
1991 any other selection or coloring actions are made.
1993 This option can be used more than once.
1994 Each substitution will be applied in sequence on each word.
1995 This sequence can be stopped if a \fBstop\fP flag is encountered.
1997 In summary, this option is similar to the \fB-S\fP|\fB-subst\fP option
1998 previously described, except that the substitutions are made earlier and
1999 certain flags like \fBvisual\fP are ignored.
2001 Note that this option can be used in conjunction with the other
2002 substitution options mentioned above.
2003 .IP "\fB-/\fP|\fB-search_method\fP \fIsearch_method\fP"
2004 (Allowed in all contexts.)
2006 Affects the '\fB/\fP' key to a search method.
2007 By default '\fB/\fP' is affected to '\fIfuzzy\fP' but the argument can
2008 be any prefix of '\fIprefix\fP', '\fIsubstring\fP' or '\fIfuzzy\fP'.
2009 .IP "\fB-s\fP|\fB-sp\fP|\fB-start\fP|\fB-start_pattern\fP \fIpattern\fP"
2010 (Allowed in all contexts.)
2012 Place the cursor on the first word corresponding to the specified pattern.
2014 Note that although only the first matching word is highlighted,  all
2015 matching words (if any) can be accessed using \fBn\fP/\fBs\fP/\fBSPACE\fP
2016 and \fBN\fP/\fBS\fP keys as if they were the result of one of the
2017 search actions.
2019 These matching words can also be tagged at once if the tagging/pinning
2020 function is activated.  See the "Tagging" section for more information.
2022 \fBESC\fP can be used to disable navigation among matching words.
2024 \fIpattern\fP can be:
2026 .IP \(bu 2
2027 A \fB#\fP immediately followed by a \fBnumber\fP giving the initial
2028 position of the cursor (counting from 0).
2030 If the word at this position is excluded, then the first previous non
2031 excluded word is selected if it exists, otherwise the first non excluded
2032 word is selected.
2034 If this number if greater than the number of words, the cursor will be
2035 placed on the latest selectable position.
2036 .IP \(bu 2
2037 A single \fB#\fP or the string \fB#last\fP to set the initial
2038 cursor position on the latest selectable word position.
2039 .IP \(bu 2
2040 A string starting with a \fB/\fP indicating that we want the cursor
2041 to be placed on the first word matching the given regular expression.
2042 .IP \(bu 2
2043 A string starting with a \fB=\fP indicating than we want the cursor
2044 to be placed on that exact word.
2045 .IP \(bu 2
2046 A normal string. In this case the cursor will be placed on the
2047 first word starting with that string (\fBCa\fP will match \fBCancel\fP
2048 by example).
2050 \fBWarning\fP, when searching for a prefix or a regular expression, smenu
2051 only looks for them after an eventual modification, so for example,
2052 the command:
2053 \f(CBsmenu -I/c/x/ -s/c <<< "a b c d"\fP won't find c and put the cursor
2054 on \fBa\fP but \f(CBsmenu -I/c/x/v -s/c <<< "a b c d"\fP will find it and
2055 put the cursor on the \fBx\fP substituting the \fBc\fP on screen only
2057 \fI\\u\fP and \fI\\U\fP sequences can be used in the pattern.
2059 .IP "\fB-x\fP|\fB-tmout\fP|\fB-timeout\fP \fItype\fP [\fIword\fP] \fIdelay\fP"
2060 .IP "\fB-X\fP|\fB-htmout\fP|\fB-hidden_timeout\fP \fItype\fP [\fIword\fP]\
2061  \fIdelay\fP"
2062 (Allowed in all contexts.)
2064 Sets a timeout.
2065 Three types of timeout are possible:
2067 .TP 10
2068 current:
2069 At the timeout, the word under the cursor and/or the tagged words are
2070 sent to the standard output if the \fBENTER\fP key has been pressed
2071 .TP 10
2072 quit:
2073 At the timeout, nothing is selected as if the \fBq\fP key has been pressed
2074 .TP 10
2075 word:
2076 At the timeout, the word given after the type is selected.
2077 Note that this word doesn't need to be part of the words coming from
2078 the standard input.
2080 Each type can be be shortened as a prefix of its full name ("cur" for
2081 "current" of "q" for "quit" per example).
2083 The delay must be set in seconds and cannot be greater than 99999 seconds.
2085 The remaining time (in seconds) is added at the end of the message
2086 displayed above the selection window and is updated in real time each
2087 second.
2089 Any key except \fBENTER\fP, \fBq\fP, \fBQ\fP and \fBCTRL\ C\fP resets
2090 the timer to its initial value.
2092 The \fB-X\fP|\fB-htmout\fP|\fB-hidden_timeout\fP version works like
2093 \fB-x\fP|\fB-tmout\fP|\fB-timeout\fP but no periodic remaining messages
2094 is displayed above the selection window.
2096 .IP "\fB-r\fP|\fB-auto_validate\fP"
2097 (Allowed in all contexts.)
2099 Enables \fBENTER\fP to validate the selection even in search mode.
2100 .IP "\fB-is\fP|\fB-incremental_search\fP"
2101 (Allowed in all contexts.)
2103 By default, when a new search session is initiated, the current search
2104 buffer is reset.
2105 When this parameter is set, the next search will start where the last
2106 search ended, except if \fBESC\fP was hit before.
2108 This option instructs not to clean the previous search buffer each time
2109 a new search session is started.
2110 .IP "\fB-v\fP|\fB-vb\fP|\fB-visual_bell\fP"
2111 (Allowed in all contexts.)
2113 By default, when searching, an alarm is produced by the terminal when
2114 the user enters a character or makes a move which lead to no result or
2115 to an error condition.
2116 This argument make this beep visual by briefly showing the cursor.
2117 .IP "\fB-Q\fP|\fB-ignore_quotes\fP"
2118 (Allowed in all contexts.)
2120 Using this option will remove the word grouping feature from single and
2121 double quotes which will be considered normal characters.
2122 For example: \f(CB"a b"\fP will be considered by smenu as two words
2123 \fB"a\fP and \fBb"\fP and no more as a single word: \fBa b\fP.
2124 .IP "\fB-lim\fP|\fB-limits\fP \fIlimit:value\fP..."
2125 (Allowed in all contexts.)
2127 This option gives the possibility to modify the default maximum number
2128 of words or columns and the maximum permitted word length.
2130 The specified values overload the default settings and/or the settings
2131 given in the configuration files.
2134 In order to do that, three sub-options can be used:
2135 .IP \fBl\fP:value 2
2136 to set the maximum word length allowed.
2137 .IP \fBw\fP:value 2
2138 to set the maximum number of words allowed.
2139 .IP \fBc\fP:value 2
2140 to set the maximum number of columns allowed.
2142 Several sub-options, separated by spaces, can be given after this option.
2145 .IP "\fB-f\fP|\fB-forgotten_timeout\fP|\fB-global_timeout\fP \fItimeout\fP"
2146 (Allowed in all contexts.)
2148 This option defines a global timeout in seconds.
2149 The program will end without error after this period of inactivity.
2151 This timer is reset to its initial value each time a key is pressed.
2153 Its default value is "unlimited", but it can be changed by assigning a
2154 number (in tenths of seconds) to the "forgotten" entry in the [timers]
2155 section of the optional configuration file.
2156 See the example in the configuration sub-section.
2158 A \fItimeout\fP value equals to \fB0\fP explicitly disables this timer.
2159 .IP "\fB-nm\fP|\fB-no_mouse\fP"
2160 (Allowed in all contexts.)
2162 This option allows you to disable the mouse even if smenu can use it.
2163 .IP "\fB-br\fP|\fB-buttons\fP|\fB-button_remapping\fP \fInew_button_1\fP \
2164 \fInew_button_3\fP"
2165 (Allowed in all contexts.)
2167 This option allows one to remap the mouse buttons.  The buttons are numbered
2168 from 1 to 3 but as smenu only uses buttons 1 and 3, only two arguments
2169 are required.
2171 By example, the syntax \f(CR-br 3 1\fP will reverse the first (left)
2172 and third (right?) buttons.
2174 The default mapping is \f(CR1 3\fP.
2175 .IP "\fB-dc\fP|\fB-dcd\fP|\fB-double_click\fP|\fB-double_click_delay\fP \
2176 \fIdelay_in_ms\fP"
2177 (Allowed in all contexts.)
2179 This option allows one to set the double-click delay in the range of 100 ms
2180 (1/10 second) to 500 ms (1/2 second).
2181 The default delay of 150 ms (1/6.66 second) will be used if the given
2182 value is out of range or invalid.
2184 The double-click capability can also be disabled by setting
2185 \fIdelay_in_ms\fP to \fB0\fP.
2187 This setting is also configurable in a configuration file, see the
2188 [mouse] section in the example in the configuration sub-section.
2189 .IP "\fB-sb\fP|\fB-sbw\fP|\fB-show_blank_words\fP [\fIblank_char\fP]"
2190 (Allowed in all contexts.)
2192 Normally, blank words (words containing only space:.!fmt
2193 s) are only kept in column mode.
2194 When this option is present, these words are converted into a sequence
2195 of \fIblank_char\fP (or underscore if the optional parameter is absent)
2196 so that they are visible and not ignored when not in column mode.
2198 \fIblank_char\fP must be printable but not a space nor a multibyte
2199 character.
2201 Note: These blank words remain blank even if they are now made
2202 visible. They can still be excluded using \f(CB-e '\ '\fP
2203 or \f(CB-e '[ ]'\fP per example.
2204 .SH NOTES
2205 If tabulators (\fI\\t\fP) are embedded in the input, there is no way
2206 to replace them with the original number of spaces.
2207 In this case use another filter (like \fIexpand\fR) to pre-process
2208 the data.
2209 .SH EXAMPLES
2210 .SS 1
2211 Simple Yes/No/Cancel request with "No" as default choice:
2214 \f(CRIn \fBbash\fP:
2215   \f(CBread R <<< $(echo "Yes No Cancel" \\
2216                | smenu  -d -m "Please choose:" -s /N)\fP
2219   \f(CBR=$(echo "Yes No Cancel" \\
2220       | smenu -d -m "Please choose:" -s /N)\fP
2222 In \fBksh\fP:
2223   \f(CBprint "Yes No Cancel"                \\
2224   | smenu -d -m "Please choose:" -s /N \\
2225   | read R\fP
2228 .SS 2
2229 Get a 3 columns report about VM statistics for the current process in
2230 \fBbash\fP/\fBksh\fP on Linux:
2233 \f(CBR=$(grep Vm /proc/$$/status | expand | smenu -b -W$'\\n' -t3 -g -d)\fB
2237 .SS 3
2238 Create a one column selection window containing the list of the first
2239 20 LVM physical volumes.
2240 At the end, the selection window will be erased.
2241 This example is written in \fBksh\fP).
2244 \f(CB
2245 pvs -a -o pv_name --noheadings                 \\
2246 | smenu -m "PV list" -n20 -t1 -d -s //dev/root \\
2247 | read R
2251 The display will have a look similar to the following with the cursor
2252 set on the word \fI/dev/root\fP:
2255 \f(CRPV list
2256 /dev/md126           \\
2257 /dev/md127           |
2258 /dev/root            | <- cursor here.
2259 /dev/sda2            |
2260 /dev/sdb2            |
2261 /dev/sdc1            |
2262 /dev/sdc2            |
2263 /dev/system/homevol  /
2266 .SS "4 (advanced)"
2267 Imagine a file named \fBsample.mnu\fP with the following content:
2270 \f(CR--8<---------------------------------
2271 "1 First Entry" "3 Third entry"
2272 "2 Second entry" "4 Fourth entry"
2273 @@@ "5 Fifth entry"
2275 "0 Exit menu"
2276 --8<---------------------------------
2280 Then this quite esoteric command will render it (centered on the screen) as:
2283 \f(CR+----------------------------------+
2284 |            Test menu             |
2285 |                                  |
2286 | 1) First Entry   3) Third entry  |
2287 | 2) Second entry  4) Fourth entry |
2288 |                  5) Fifth entry  |
2289 |                                  |
2290 | 0) Exit menu                     |
2291 +----------------------------------+
2295 with the cursor on \fIQuit\fP and only the numbers and "Quit" selectable.
2297 \f(CBR=$(smenu -q -d -s/Exit -M -n 30 -c        \\
2298           -e "@+" -E '/@+/ /'              \\
2299           -F -D n:1 i:1                    \\
2300           -m "Test menu" < sample.mnu)
2302 The selected entry will be available in \f(CBR\fP
2304 Try to understand it as an exercise.
2305 .SH ENVIRONMENT
2307 tab(@);
2308 l l.
2309 \fINO_COLOR\fP@force a monochrome terminal when set.
2310 \fICTXOPT_DEBUG\fP@put the option parser in debug mode.
2312 .SH BUGS/LIMITATIONS
2313 Some terminal emulators, those notably based on VTE version later than
2314 0.35 (see https://github.com/GNOME/vte/commit/01380d), have a new feature
2315 that gives them the possibility to wrap/unwrap already displayed lines
2316 when resizing the window.
2318 As far as I known, there is no terminfo entry to disable that.
2320 On these types of terminals, the automatic re-display of the output of
2321 smenu will be disturbed and some artifacts may appear on the screen if
2322 the terminal window is resized.
2323 .SH AUTHORS
2324 \(co 2015-present, Pierre Gentile (p.gen.progs@gmail.com)