Take UTF-8 spaces into account for empty strings
[smenu.git] / smenu.1
blobfe06b46e14cfca49b8b56f4f768f090307f28209
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 When the mouse is supported, the cursor can turn into an arrow (but
249 not always) and the mouse can then be used as a point and click device
250 as follows:
252 \fBFirst (usually left) mouse button (note that buttons can be remapped)\fP:
253 .RS 2
254 .IP \(bu 2
255 A click on a word selects it if it is selectable.
256 .IP \(bu 2
257 A click on a word while holding the CTRL key pressed when tagging/pinning
258 is activated marks/unmarks this word.
259 .IP \(bu 2
260 A Click at the ends of the vertical scroll bar (if present) is equivalent
261 to pressing the keyboard's up or down arrow.
263 A click anywhere else on the vertical scroll bar moves the cursor to
264 another word, depending on where you click.
266 The new current word will be positioned at the beginning of a line
267 if possible.
269 A click at the ends of the horizontal scroll bar (if present) is
270 equivalent to pressing the keyboard's left or right arrow.
272 A click anywhere else on the horizontal scroll bar moves the cursor left
273 of right on the line containing the cursor, but does not move it further
274 than the first or last word on that line.
275 .IP \(bu 2
276 A double-click on a word selects it, if selectable, and acts as if the
277 Enter key had been pressed, the double-click delay being configurable.
278 .IP \(bu 2
279 A click on the left or right horizontal arrow of each line (when visible)
280 shifts the content of the window to the left or right, one word at a time.
282 Nothing happens if the cursor risks leaving the window.
284 Note that clicking on a left-facing arrow in an empty line means that
285 not all the words in that line could be displayed because of previous
286 shifts or moves.
287 In this case, smenu will try to display the last word of this line but
288 it is not always possible as the cursor must remain visible.
290 The keyboard commands \fB<\fP and \fB>\fP can be used in such a case
291 because the cursor is already on the current line.
294 \fBThird (usually right) mouse button\fP:
295 .RS 2
296 .IP \(bu 2
297 When tagging or pinning is enabled, a click on a word tags/untags it if
298 it is selectable.
299 .IP \(bu 2
300 When tagging or pinning is enabled, a click on a word while holding the
301 CTRL key pressed has the following actions:
302 .RS 2
303 .IP - 2
304 If the word clicked is selectable and no word is already marked then
305 marks it.
306 .IP - 2
307 If a word is marked and the clicked word is selectable and is not the
308 marked word, then:
309 .RS 2
310 .IP + 2
311 In column mode, if the marked word is in the same column/line as the
312 clicked word, tags all words bounded by those words in that column/line
313 as if \fBZ\fP the keyboard command were used.
314 .IP + 2
315 In line or column mode, if the marked word is in the same line as the
316 clicked word, tags all words bounded by those words in that line.
317 .IP + 2
318 Otherwise, tags all words bounded by the marked word and the
319 clicked one.
320 .IP + 2
321 In all cases, the mark is removed.
326 \fBMouse wheel\fP:
327 .RS 2
328 .IP \(bu 2
329 Rotating the mouse wheel scrolls the contents of the window one line up
330 or down.
331 .IP \(bu 2
332 Rotating the mouse wheel while holding down the \fBCTRL\fP key scrolls
333 the contents of the window one page up or down.
335 This feature may not work depending on the terminal and operating system.
337 Be sure to use the wheel when the mouse pointer is over the smenu
338 window, as some terminal emulators may otherwise zoom the screen in
339 and out instead.
342 Remember that mouse support does not disable the keyboard, so use the
343 keys instead if the mouse is not working properly.
345 Some terminals may not report clicks after the 223rd line or column due
346 to a limitation of the old X11 mouse tracking protocol, one example of
347 such a terminal emulator is screen < 4.7.0.
348 tmux as well as screen >= 4.7.0 are fine.
350 Keyboard and mouse can be used at the same time.
351 .TP 2
352 \fBRemark 1.\fP
353 Some X-Window terminal emulators may not support the
354 enable/disable bracketed pastes escape sequence, in such a case if
355 may be necessary to explicitly clear the content of the paste buffer
356 before running smenu so that the mouse buttons (especially for pasting)
357 do their job correctly.
359 This action can easily be performed using the command \f(CRxsel -c\fP
360 for example.
361 .TP 2
362 \fBRemark 2.\fP
363 Some X-Windows terminal emulators intercept mouse input
364 when some modifiers are used, a typical example is xterm which displays
365 popup menus in these cases.
367 For xterm (Patch #361 - 2020/10/14 or later) a working workaround
368 is to use the X resource \f(CRXTerm*omitTranslation:popup-menu\fP
369 either by adding it in your \f(CR.Xresources\fP file and register
370 it with \f(CRxrdb\fP or by launching xterm using the
371 \f(CR-xrm 'XTerm*omitTranslation:popup-menu'\fP command line option.
372 .TP 2
373 \fBRemark 3 for BSD systems.\fP
374 In order for the mouse to work properly under (virtualised?) FreeBSD
375 and perhaps other BSD variants, it may be necessary add the following
376 two lines to the file \fB~/.Xmodmap\fP:
379 \f(CR! Disable button 8 and 9.
380 pointer = 1 2 3 4 5 6 7 0 0 10 11 12\fP
383 And run the command: \f(CRxmodmap ~/.Xmodmap\fP
384 (ignore any warnings issued by this command).
386 This can also be done non-permanently by running the command:
388 \f(CRxmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 10 11 12"\fP
391 If this is not enough, try to disable buttons 8 to 12.
395 \fBDirect access:\fP
396 .RS 2
397 If \fB-N\fP|\fB-number\fP, \fB-U\fP|\fB-unnumber\fP or
398 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP are used, then it becomes
399 possible to directly access a word by entering its number.
400 The numbering created using these option is done \fBbefore\fP any words
401 substitution done using \fB-S\fP|\fB-subst\fP \fI/regex/repl/opts\fP,
402 \fB-I\fP|\fB-si\fP|\fB-subst_included\fP or
403 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP.
405 Using a combination of these options, it is easy to control which words
406 will be numbered by adding a special symbol in it before using smenu and
407 removing it (substituted by nothing) afterward using
408 \fB-I\fP|\fB-si\fP|\fB-subst_included\fP by example.
410 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP gives another way to do that,
411 see below or more.
413 .SS "Changing input words"
414 smenu offers the possibility to modify the input words in a sed-like way.
415 Words can be modified at two points: just after they have been read
416 and after other operations have been applied, such as enabling,
417 disabling or coloring.
419 The related options are \fB-ES\fP|\fB-subst\fP,
420 \fB-S\fP|\fB-subst\fP, \fB-I\fP|\fB-si\fP|\fB-subst_included\fP and
421 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP their descriptions can be found
422 in the \fBOPTIONS\fP section.
423 .SS "Searching for words"
424 A word can be searched using different algorithms: \fIprefix\fP,
425 \fIsubstring\fP of \fIfuzzy\fP.
427 \fIprefix\fP (keys \fB^\fP or \fB=\fP):
428 The sequence of characters entered must match the beginning of a word.
430 \fIsubstring\fP (keys \fB"\fP or \fB'\fP):
431 The sequence of characters entered must match a substring in a word.
433 \fIfuzzy\fP (keys \fB~\fP or \fB*\fP):
434 All the characters in the entered sequence must appear in the same order
435 in a word, but need not be consecutive.
437 The case is also ignored.
439 Note that spaces and tabs at the beginning and end of words are ignored
440 when searching for substrings or fuzzy strings.
442 The cursor is placed, if possible, on the first matching word having the
443 minimum number of gaps between the first and last matching character,
444 see the difference between the actions of the \fBs\fP/\fBS\fP and
445 \fBn\fP/\fBN\fP keys below.
447 This method also tolerates intermediate symbols not appearing in the
448 words which will be ignored.
449 If this is the case, the attributes of the approximately matching
450 words are changed into an error versions of them to warn the user to
451 this situation.
453 The erroneous symbols will \fInot\fP be inserted in the search buffer.
455 For example: if the word \fBabcdef\fP is present in the standard input,
456 then entering \f(CBabxcdye\fP puts \fBabcdef\fP in the search buffer
457 and the word is added to the list of matching words and displayed with
458 an error attribute (in red by default).
460 This special state will persist until all the symbols following the first
461 erroneous one are deleted (using backspace) or if \fBESC\fP is pressed
462 to cancel the search session and clear the search buffer.
464 During a search session, the cursor changes and each character entered is
465 added in (or removed from) the search buffer.
466 The display is refreshed after each change in this buffer.
468 A 10 seconds timeout (by default) automatically ends the current
469 search session as if the \fBEnter\fP key had been pressed.
470 This timeout is reset each time a new key is hit in search mode.
471 This delay can be configured using the \fBsearch\fP entry in the
472 \fBtimers\fP section of the configuration file as shown in the example
473 in the configuration subsection.
475 The slash key (\fB/\fP) can also be used instead of any of these keys.
476 By default it is is programmed to do a \fIfuzzy\fP search but this can
477 be changed by using the command line option
478 (\fB-/\fP|\fB-search_method\fP) or by tuning a configuration file,
479 see below.
481 All the words matching the current search buffer are enhanced:
482 The characters present in the current search buffer are highlighted in
483 one way and the other characters in another way.
484 Both of these highlighting methods are configurable.
486 If the user has entered the search sequence: \fBo\fP, \fBs\fP, then the
487 matching word "words" will be displayed as \fBw\fP\fIo\fP\fBrd\fP\fIs\fP
488 when the \fIfuzzy\fP algorithm is in use depending of the display
489 attributes configured.
491 \fBENTER\fP and all cursor moves terminate the search session but do
492 not clear the list of the matching words and the search buffer.
494 The user can then use the \fBn\fP/\fBs\fP/\fBSPACE\fP keys (forward) and
495 the \fBN\fP/\fBS\fP keys (backward) to navigate in the list of matching
496 words,
498 In \fIfuzzy\fP search mode, the \fBs\fP/\fBS\fP keys attempt to move the
499 cursor to the next/previous word whose matching part forms a substring
500 of this word.
501 If no such matches exist, \fBs\fP/\fBS\fP and \fBn\fP/\fBN\fP do the
502 same things.
503 To move the cursor to the next/previous fuzzy match, use the
504 \fBn\fP/\fBN\fP/\fBSPACE\fP keys.
505 \fBs\fP means next \fPs\fPubstring match in this context while \fBn\fP
506 just means \fBn\fPext match.
508 If the user hits the \fBHOME\fP or \fBEND\fP key during a search session
509 then the list of matching words is reduced to the words starting
510 (respectively) ending with the current search pattern and the window
511 is refreshed.
512 For those who consider \fBHOME\fP and \fBEND\fP as non-intuitive,
513 the \fBCTRL\ A\fP and \fBCTRL\ Z\fP keys are also available in search mode
514 as an alternative.
515 This behavior is persistent until the user hit the \fBESC\fP or
516 \fBENTER\fP key.
518 For example, if the search pattern in substring mode is \f(CBsh\fP and
519 the user hits \fBEND\fP, then only the words \fIending\fP with \f(CBsh\fP
520 will be added in the searched word list and enhanced.
522 Note that when a matching word is selected, its enhanced characters only
523 show one of the multiple matching possibilities.
525 When not in a search session \fBESC\fP can be also used to clear the
526 list of matching words and to reset the search buffer.
528 Note that the search buffer is persistent as long as the same search
529 algorithm is used and \fBESC\fP has not been pressed.
530 .SS "Selection and Exit"
531 Pressing \fBq\fP gives the possibility to exit without selecting anything.
533 \fBCTRL\ C\fP (Abort) also exits the program immediately with a return
534 code equal to 128+SINGINT (by default) without selecting anything.
535 See the \fB-!\fP|\fB-int\fP|\fB-int_string\fP option for more information
536 about the customization of the \fBCTRL\ C\fP behavior.
538 By default, \fBENTER\fP or a double click with the first mouse button if
539 applicable writes the selected word to stdout when not in
540 search mode otherwise it exits from this mode and does nothing more.
541 If you want to be able to select a word \fIeven\fP when in search mode,
542 use the \fB-r\fP|\fB-auto_validate\fP option to change this behavior.
543 .SS "Tagging (multiple selections)"
544 When the tagging is activated by using the command line
545 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP
546 or \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP option, then the
547 keys \fBt\fP, \fBu\fP, \fBINS\fP, \fBDEL\fP \fBc\fP, \fBr\fP,
548 \fBm\fP, \fBM\fP, \fBT\fP, \fBC\fP, \fBR\fP and \fBU\fP, can be
549 used to tag/untag some words.
550 These tagged words will then be sent to the standard output when
551 \fBENTER\fP is pressed.
553 Their meanings is as follows:
555 \fBt\fP
556 Tags/untags or Pin/unpin the word under the cursor (toggle).
558 \fBu\fP
559 Untags or unpins the word under the cursor.
561 \fBINS\fP
562 Tags or pins the word under the cursor.
564 \fBDEL\fP
565 Untags or unpins the word under the cursor.
567 \fBc\fP
568 Tags or pins all the selectable words in the current \fBcolumn\fP when
569 no word is marked, otherwise acts like \fBC\fP.
571 \fBr\fP
572 Tags or pins all the selectable words in the current \fBrow/line\fP
573 when no word is marked, otherwise acts like \fBR\fP.
575 \fBm\fP
576 Marks the current word, the cursor aspect will change until the word
577 is unmarked.
579 \fBM\fP or \fBESC\fP
580 Unmarks the current word, other actions will also automatically unmark
581 the word, see below.
583 \fBT\fP
584 If no word are marked and the result of a search is still displayed then
585 tags all words found in this search.
587 If no word has been searched and no word is marked, then the current
588 word is marked, just as if \fBm\fP has been used instead.
589 Otherwise all words between the marked word and the
590 current word are tagged.
592 The marked word will no longer be marked after tagging is complete.
594 \fBZ\fP
595 Like \fBT\fP when not in search mode and when the marked words is not
596 on the same column or line as the cursor in column mode.
598 When in column mode and if the marked word is in the same column or line
599 as the cursor, tags only the words in the same column (respectively line)
600 bounded by the marked word and the cursor.
602 \fBC\fP
603 As for \fBT\fP, \fBC\fP marks the current word if no word is currently
604 marked, just as if \fBm\fP had been used instead.
606 If a word is already marked, \fBC\fP tags/pins the words between the
607 current and the marked words if they are the \fBsame column\fP.
609 The marked word will no longer be marked after tagging is complete.
611 \fBR\fP
612 As for \fBT\fP, \fBR\fP marks the current word if no word is currently
613 marked, just as if \fBm\fP has been used instead.
615 If a word is already marked, \fBR\fP tags/pins the words between the
616 current and the marked words if they are the \fBsame row/line\fP.
618 The marked word will no longer be marked after tagging is complete.
620 Note that when you use \fBT\fP, \fBC\fP or \fBR\fP with pinning enabled,
621 the order of word selection depends on whether the marked word is before
622 or after the current word.
624 When a word is marked, the pinning order using \fBc\fP and \fBr\fP
625 increases from the marked word to the current word.
627 When no words are marked, the pinning order when using \fBc\fP and \fBr\fP
628 always increases from top to bottom and from left to right respectively.
630 \fBU\fP
631 Untags or unpins the last tagging action.
633 \fBCTRL T\fP
634 Untags all the previously tagged/pinned words.
636 The marked word, if any, will no longer be marked after this action.
638 Also note that using some of these keys may be more easily achieved by
639 using the third mouse button (usually the right one) when the mouse
640 is available.
642 See how to use the right mouse buttons in the "Keyboard and mouse
643 usage." at the beginning of this manual.
644 .SS Help
645 A small help message can be displayed when hitting the \fB?\fP key.
646 This message will last for 10s or until another key or \fBESC\fP is
647 pressed.
648 .SS "Scroll bars"
649 The vertical scroll bar is displayed at the right of the scrolling window.
650 Its appearance is meant to be classical but it has some particularities:
651 .IP \(bu 2
652 The vertical scroll bar is not displayed if all the input words fit on
653 only one line.
654 .IP \(bu 2
655 Otherwise, the vertical scroll bar is always displayed except when
656 the \fB-q\fP option is set.
657 This option completely disables the scroll display of all scroll bars.
658 .IP \(bu 2
659 When the scrolling window has only one line, the vertical scroll bar
660 has only 3 states:
661 .RS 2
662 .IP - 2
663 \fBv\fP when on all but the last line, indicating that you can go down
664 to see more.
665 .IP - 2
666 \fB^\fP when on the last line.
667 .IP - 2
668 \fB|\fP otherwise.
670 .IP \(bu 2
671 When there is more than one line to display, \fB/\fP means that the window
672 displays the first line, \fB\\\fP the last line.
673 \fB|\fP is used to fill the gap, see below the different possible
674 configurations.
676 tab(@);
677 l l l l l
678 l l l l l
679 l l l l .
680 \\@\\@^@^@\\ @Do not remove this trailing space!
681 |@|@|@|@/
682 /@v@/@v
685 A \fB+\fP can also appear in the scroll bar in lieu of the vertical bar,
686 giving the relative position of the cursor line in the bunch of input
687 words.
689 The horizontal scroll bar is only displayed below the window when the
690 current line is truncated in line of column mode.
692 If its appearance scrolls up the windows in the screen, the new position
693 of the window will unchanged even it this scroll bar is no more displayed
694 as the line containing the cursor is no more truncated.
695 .SS "Terminal resizing (also see BUGS/LIMITATIONS)"
696 The windows is redrawn if the terminal is resized.
697 The redrawing is actually done only 1s after the end of the resizing to
698 avoid artifacts on screen.
699 The cursor will remain on the current selected word but may be displayed
700 at another place in the window.
701 .SS "Unicode support"
702 This utility is Unicode aware and should be able to display correctly
703 any Unicode character (even double-width ones) as long as the current
704 encoding is \fBUTF-8\fP (\fBUTF-8\fP in the output of the \fIlocale\fP
705 command).
707 Note that smenu will not attempt to normalize words containing UTF-8 glyphs.
708 Thus \fI\\u61\\ucc88\fP (\fIä\fP) will not be considered equal to
709 \fI\\uc3a4\fP (canonical normalization of Â \fIä\fP).
710 It is nevertheless possible to use an external tool such as uconv from the
711 ICU project (https://icu.unicode.org) to do this work before using smenu.
713 For example: uconv can be used as a filter as in:
715 \f(CBcat ... | uconv -x any-nfc | smenu\fP
716 .SS "Optional configuration file"
717 If a file with adequate permissions and the same name as the executable
718 but prefixed with a dot is present in the current directory
719 or in the user's home directory, then it will be parsed as a
720 \fI.ini\fP file.
721 The values read from the file in the home directory will be overridden by
722 the ones read from the local directory (if it is present).
724 Missing and bad keywords are silently skipped.
726 The values read, if valid, override the default hard-coded ones.
728 If a value is invalid an error message is shown and the program terminates.
730 The values of the timers must be given in units of \fB1/10\fP of a second.
732 Here is an example giving the syntax and the names of the keywords
733 allowed:
736 \f(CR--8<------------------------------------------------------------------
737 [colors]
738   ; The terminal must have at least 8 colors and/or have attributes
739   : like bold and reverse for this to be useful
740   ; if not the following settings will be ignored.
742   method=ansi             ; classic | ansi (default)
744   cursor=0/2              ; cursor attributes
745   cursor_on_tag=0/2,u     ; cursor on tag attributes
746   shift=6,b               ; shift symbol attributes
747   message=0/3             ; message (title) attributes
748   bar = 7/4,b             ; scroll bars attributes
749   search_field = 0/6      ; search field attributes
750   search_text = 7,bu      ; search text attributes
751   match_field = 1,b       ; matching words field attributes
752   match_text = 7,bu       ; matching words text attributes
753   search_err_field = 1    ; approximate search field attributes
754   search_err_text = 1,r   ; approximate search text attributes
755   ; match_err_field = 3   ; approximate matching words field attributes
756   match_err_text = 1      ; approximate matching words text attributes
757   ; include = b           ; selectable color attributes
758   exclude = 4/0,u         ; non-selectable color attributes
759   tag = 0/5               ; tagged (selected) attributes
760   daccess = 3,b           ; direct access tag attributes
762   special1 = 7/4,b        ; attributes for the special level 1
763   special2 = bu           ; attributes for the special level 2
764   special3 = /3,b         ; attributes for the special level 3
765   special4 = 7/4          ; attributes for the special level 4
766   special5 = 7/2,b        ; attributes for the special level 5
767   special9 = 2,rb         ; attributes for the special level 9
769 [window]
770   lines = 7               ; default number of lines of the window
772 [limits]
773   word_length = 1024      ; arbitrary max length of input words (int)
774   words = 32767           ; arbitrary max number of allowed input
775                           ; words (int)
776   columns = 128           ; arbitrary max number of columns (int)
778 [timers]
779   search = 100            ; search timeout in 1/10 s
780   help = 150              ; duration of the help message in 1/10 s
781   window = 7              ; delay before redrawing if the size of the
782                           ; terminal's window change in 1/10 s
783   direct_access = 6       ; duration allowed to add a new digit to
784                           ; the direct word access number in 1/10 s
785   forgotten = 9000        ; An explicit delay (in 1/10 s) before smenu
786                           ; is forced to stop as if "q" had been pressed.
787                           ; Useful when one forgot to make a selection.
789 [misc]
790   default_search_method = substring
792 [mouse]
793   double_click_delay= 200 ; delay in milliseconds
794 --8<------------------------------------------------------------------
797 .IP \(bu 2
798 The \fBmethod\fP keyword can take the two possible values displayed
799 above and determines if you want to use the native method (limited to 8
800 colors) of the \fBansi\fP method (ISO 8613-6) if your terminal supports
801 more than 8 colors.
803 The default value corresponds to \fBansi\fP.
805 The attributes syntax is [fg][/bg][[,.+]toggles] where \fBfg\fP and
806 \fBbg\fP are numbers representing the foreground and background color
807 and \fBtoggles\fP is a strings which can contain the characters \fIb\fP,
808 \fId\fP, \fIr\fP, \fIs\fP, \fIu\fP, \fIi\fP, \fIn\fP and \fIl\fP
809 representing respectively \fIb\fPold, \fId\fPim, \fIr\fPeverse,
810 \fIs\fPtandout, \fIu\fPnderline, \fIi\fPtalic, i\fIn\fPvisible
811 and b\fIl\fPink.
812 .IP \(bu 2
813 Spaces are allowed anywhere in the lines and between them, even around
814 the \fB=\fP.
815 .IP \(bu 2
816 Everything following a \fB;\fP is ignored.
817 .IP \(bu 2
818 When undefined, the default limits are:
820 tab(@);
821 l l .
822 words@32767
823 word_length@512
824 columns@256
826 .SH OPTIONS
828 Not all options may be available, depending on the current context.
830 When smenu is called and before the first option is evaluated, it is in
831 the \fBMain\fP context.
832 Each option can switch to another context in which only a subset of the
833 options is usable.
835 For each parameter described below, the contexts in which the associated
836 option is defined as well as the context to which it leads, if any,
837 are given.
839 An option not defined in a context will force the end of the current
840 context and will be recursively evaluated in the previous contexts until
841 found (or not).
842 If not found, an error message is displayed and smenu is terminated.
844 The contexts defined in smenu are:
845 .IP \fBMain\fP 2
846 The default context
847 .IP \fBColumns\fP 2
848 After the \fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP parameter.
849 .IP \fBLines\fP 2
850 After the \fB-l\fP|\fB-line\fP|\fB-line_mode\fP parameter.
851 .IP \fBTabulations 2
852 After the \fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP parameter.
853 .IP \fBTagging\fP 2
854 After the \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP or
855 \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP parameter.
857 .IP \fBWARNING\fP 2
858 Here is a situation that may seem confusing at first glance.
860 Imagine the only parameter command line parameter is \fB-cols_select\fP.
862 Since this is a parameter of an option which is not valid when not in
863 the \fBColumns\fP context, it should have raised an error but it still
864 seems to be accepted.
866 The trick is: when not in column mode \fB-cols_select\fP is indeed not
867 accepted but its prefix (\fB-col\fP) is valid.
868 The options are thus understood as: \fB-col\fP \fB-s_select\fP.
869 The same mechanism occurs again as \fB-s\fP is also valid in column
870 mode so the final understanding of the command line is: \fB-col\fP
871 \fB-s\fP \fB_select\fP.
873 Another example that illustrates the fact that long parameters have
874 priority over short parameter combinations: \fB-is\fP will not select
875 only words containing a "\fBs\fP", but will act in the same way as its
876 alternative name (\fB-incremental_search\fP).
878 If you really want to select only words containing a "\fBs\fP", simply
879 add a space after the \fBi\fP as in \fB-i s\fP or use one of the other
880 \fB-i\fP names such as \fB-inc\fP for example.
882 In such cases, the user may set the \fBCTXOPT_DEBUG\fP environment
883 variable which any non-empty content.
885 If we reconsider the \fB-cols_select\fP example with \fBCTXOPT_DEBUG\fP set
886 the output is now:
889 CTXOPT_DEBUG: Parameter: -cols_select. Evaluation context: Main.
890 CTXOPT_DEBUG: Found a valid parameter as a prefix of -cols_select: -col.
891 CTXOPT_DEBUG: Parameter: -col. Evaluation context: Main.
892 CTXOPT_DEBUG: Switch to context Columns.
893 CTXOPT_DEBUG: Parameter: -s_select. Evaluation context: Columns.
894 CTXOPT_DEBUG: Found a valid parameter as a prefix of -s_select: -s.
895 CTXOPT_DEBUG: Parameter: -s. Evaluation context: Columns.
896 CTXOPT_DEBUG: Argument: _select.
899 In this case, adding a space in the command line: \fB-col\fP
900 \fB-cols_select\fP \fB1\fP also solves the issue and indicates that only
901 the first column should be selectable.
903 Note, however, that at least one argument for \fB-cols_select\fP is
904 now required:
907 CTXOPT_DEBUG: Parameter: -col. Evaluation context: Main.
908 CTXOPT_DEBUG: Switch to context Columns.
909 CTXOPT_DEBUG: Parameter: -cols_select. Evaluation context: Columns.
910 CTXOPT_DEBUG: Argument: 1.
913 The \fB-h\fP|\fB-help\fP and \fB-?\fP|\fB-u\fP|\fB-usage\fP options now
914 display the help and synopsis of the available options in the current
915 context.
916 .IP Example: 2
917 \f(CBsmenu -col -u\fP will only show the usage in the \fBColumns\fP
918 context
920 The contexts contain all the non-context-changing options so, in practice,
921 the usage should be intuitive.
922 You may nevertheless have to adjust some scripts using the old smenu
923 releases as I did in the lvm_menu example.
925 Some of the advantages of this new system of options are:
926 .IP \(bu 2
927 Long parameter names are allowed
928 One dash is enough, but two are also allowed for compatibility reasons.
929 .IP \(bu 2
930 An option can be referenced by any number of parameters with short or
931 long names.
932 .IP \(bu 2
933 Auto checking of missing mandatory options, duplicated option,...
934 .IP \(bu 2
935 Only options usable in the current context are allowed.
937 This option management system is explained in more detail at
938 https://github.com/p-gen/ctxopt.
940 The description of each command line parameter is as follows:
941 .IP "\fB-h\fP|\fB-help\fP"
942 (Allowed in all contexts.)
944 Display a context specific help messages and exits.
945 .IP "\fB-H\fP|\fB-long_help\fP"
946 (Allowed in the "Main" context.)
948 Display a long (non context specific) help messages and exits.
949 .IP "\fB-?\fP|\fB-u\fP|\fB-usage\fP"
950 (Allowed in all contexts.)
952 Displays a short help message and exits.
953 .IP "\fB-V\fP|\fB-version\fP"
954 (Allowed in the "Main" context.)
956 The \fB.smenu\fP files in the user's home directory and in the current
957 directory, if present, will be ignored when this option is used.
958 .IP "\fB-n\fP|\fB-lines\fP|\fB-height\fP [\fIheight\fP]"
959 (Allowed in all contexts.)
961 Gives the maximum number of lines in the scrolling selection window.
963 If \fB-n\fP|\fB-lines\fP|\fB-height\fP is not present the number of
964 lines will be set to \fI5\fP.
966 If \fB-n\fP|\fB-lines\fP|\fB-height\fP is present without argument, then
967 the height of the terminal will be used to determine the number of lines.
968 This remains true even if the terminal is resized.
970 If \fB-n\fP|\fB-lines\fP|\fB-height\fP is present with a numerical
971 argument, this value will be used to determine the number of lines.
972 .IP "\fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP... \fIregex\fP"
973 (Allowed in all contexts.)
975 Sets the \fBi\fPnclude filter to match the selectable words.
976 All the other words will become implicitly non-selectable (excluded)
978 \fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP can be used more
979 than once with cumulative effect.
981 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp.
982 .IP "\fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP... \fIregex\fP"
983 (Allowed in all contexts.)
985 Sets the \fBe\fPxclude filter to match the non-selectable words.
986 All the other selectable words will become implicitly selectable (included)
988 \fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP can be used more
989 than once with cumulative effect.
990 This filter has a higher priority than the include filter.
992 The \fIregex\fP selections made using
993 \fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP and/or
994 \fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP are done before
995 the possible words alterations made
996 by \fB-I\fP|\fB-si\fP|\fB-subst_included\fP or
997 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP (see below).
999 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp.
1000 .IP "\fB-m\fP|\fB-msg\fP|\fB-message\fP|\fB-title\fP \fImessage\fP"
1001 (Allowed in all contexts.)
1003 Displays a message (title) above the window.
1004 If the current locale is not \fBUTF-8\fP, then all \fBUTF-8\fP characters
1005 will be replaced by the substitution character.
1007 \fI\\u\fP and \fI\\U\fP sequences can be used in the message.
1009 Note that the message will be truncated if it does not fit on a terminal
1010 line.
1011 .IP "\fB-!\fP|\fB-int\fP|\fB-int_string\fP [\fIstring\fP]"
1012 (Allowed in all contexts.)
1014 The optional \fIstring\fP argument, when present,
1015 defines the string to be used as the selection string when
1016 the \fBCTRL\ C\fP sequence is entered.
1018 If \fIstring\fP is missing then nothing will be selected.
1020 In all cases, when \fB-!\fP|\fB-int\fP|\fB-int_string\fP is present in
1021 the command line, the return code of the program will be \fB0\fP.
1023 This gives the user the choice to make the behavior of \fBCTRL\ C\fP
1024 similar to that of \fBq\fP and \fBQ\fP or to that of the Unix shell
1025 leaving the shell with a return code greater than 128.
1026 .IP "\fB-a\fP|\fB-attr\fP|\fB-attributes\fP \fIprefix:attr\fP..."
1027 (Allowed in all contexts.)
1029 Sets the display attributes of the elements displayed and the cursor.
1031 At least one attribute prefixed attribute must be given.
1033 \fIprefix\fP can take the following values:
1035 .PD 0
1036 .IP \fIi\fP
1037 included words.
1038 .IP \fIe\fP
1039 excluded words.
1040 .IP \fIc\fP
1041 cursor.
1042 .IP \fIb\fP
1043 scroll bar.
1044 .IP \fIs\fP
1045 shift indicator.
1046 .IP \fIm\fP
1047 message (title).
1048 .IP \fIt\fP
1049 tagged words.
1050 .IP \fIct\fP
1051 cursor on tagged words.
1052 .IP \fIsf\fP
1053 search field.
1054 .IP \fIst\fP
1055 search text.
1056 .IP \fIsfe\fP
1057 approximate search field with error.
1058 .IP \fIste\fP
1059 approximate search text with error.
1060 .IP \fImf\fP
1061 matching words field.
1062 .IP \fImt\fP
1063 matching words text.
1064 .IP \fImfe\fP
1065 matching words field with error.
1066 .IP \fImte\fP
1067 matching words text with error.
1068 .IP \fIda\fP
1069 direct access tag.
1073 If more than one attribute is given, they must be separated by spaces.
1075 Example: \f(CB-attr i:/5 e:4,br b:7/3,rb c:7/2,b\fP
1077 See the the \fB-1\fP|\fB-l1\fP|\fB-level1\fP option below for the
1078 description of the attributes syntax after the colon and an example.
1079 .IP "\fB-1\fP|\fB-l1\fP|\fB-level1\fP \fIregex\fP [\fIattr\fP]"
1080 .IP "\fB-2\fP|\fB-l2\fP|\fB-level2\fP \fIregex\fP [\fIattr\fP]"
1081 .IP "\fB-3\fP|\fB-l3\fP|\fB-level3\fP \fIregex\fP [\fIattr\fP]"
1082 .IP "\fB-4\fP|\fB-l4\fP|\fB-level4\fP \fIregex\fP [\fIattr\fP]"
1083 .IP "\fB-5\fP|\fB-l5\fP|\fB-level5\fP \fIregex\fP [\fIattr\fP]"
1084 .IP "\fB-6\fP|\fB-l6\fP|\fB-level6\fP \fIregex\fP [\fIattr\fP]"
1085 .IP "\fB-7\fP|\fB-l7\fP|\fB-level7\fP \fIregex\fP [\fIattr\fP]"
1086 .IP "\fB-8\fP|\fB-l8\fP|\fB-level8\fP \fIregex\fP [\fIattr\fP]"
1087 .IP "\fB-9\fP|\fB-l9\fP|\fB-level9\fP \fIregex\fP [\fIattr\fP]"
1088 (Allowed in all contexts.)
1090 Allows one to give a special display color to up to 5 classes of words
1091 specified by regular expressions.
1092 They are called \fBspecial levels\fP.
1093 Only selectable words will be considered.
1095 By default, the first 5 special levels have their foreground color set
1096 to red, green, brown/yellow, purple and cyan and the remaining 4 levels
1097 are set to white.
1098 All these colors also can be set or modified permanently in the
1099 configuration files.
1100 See the example file above for an example.
1102 The optional second argument (\fIattr\fP) can be used to override the
1103 default or configured attributes of each class.
1104 Its syntax is the same as the one used in the configuration file:
1106 [\fIfg\fP][/\fIbg\fP]\
1107 [,{\fIb\fP|\fId\fP|\fIr\fP|\fIs\fP|\fIu\fP|\fIi\fP|\fIn\fP|\fIl\fP}] \
1108 | [{\fIb\fP|\fId\fP|\fIr\fP|\fIs\fP|\fIu\fP|\fIi\fP|\fIn\fP|\fIl\fP}]
1111 Examples of possible attributes are:
1113   \f(CB2/0,bu \fPgreen on black bold underline
1114   \f(CB/2     \fPgreen background
1115   \f(CB5      \fPtext in purple
1116   \f(CBrb     \fPreverse bold
1119 \fI\\u\fP and \fI\\U\fP sequences can be used in the pattern.
1120 .IP "\fB-z\fP|\fB-zap\fP|\fB-zap_glyphs\fP \fIbytes\fP"
1121 (Allowed in all contexts.)
1123 Initializes a set of \fBUTF-8\fP characters to be ignored when reading
1124 words from stdin or a file.
1126 Example: The argument \f(CR'\\u0d\\ue282ac,'\fP means: ignore all commas,
1127 Euro signs and carriage return characters when reading from stdin or
1128 a file.
1130 As shown above \fI\\u\fP and \fI\\U\fP sequences can be used in the
1131 bytes set.
1132 .IP "\fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP [\fIdelim\fP]"
1133 (Allowed in the following contexts: "Main", "Columns", "Lines", and
1134 "Tabulations", switches to the "Tagging" context.)
1136 Allows multiple selections and switches to \fBtag\fP mode.
1137 In this mode, several selectable words can be selected without leaving
1138 the program.
1140 Tagged words are highlighted (underlined by default).
1142 The current word can be automatically tagged when the \fBENTER\fP key
1143 is pressed to complete the selection process if the
1144 \fB-p\fP|\fB-at\fP|\fB-auto_tag\fP option is
1145 also set or if no word has been tagged.
1147 Note that nothing is selected when no word is tagged and when the
1148 \fB-0\fP|\fB-noat\fP|\fB-no_auto_tag\fP option is also set.
1150 All tagged words (and possibly the world under the cursor) will be sent
1151 to the standard output separated by the optional argument given after
1152 the option \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP.
1154 Note that the \fIdelim\fP argument can contain more than one character,
1155 can contain \fBUTF-8\fP characters (in native or \fI\\u\fP or \fI\\U\fP
1156 form) and can even contain control character as in \f(CB$'\\n'\fP.
1158 A single space character is used as the default separator if none
1159 is given.
1161 \fBCaution\fP: To get exactly the same behavior as in version 0.9.11
1162 and earlier, you must also use the \fB-p\fP|\fB-at\fP|\fB-auto_tag\fP
1163 option.
1164 .IP "\fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP [\fIdelim\fP]"
1165 (Allowed in the following contexts: "Main", "Columns", "Lines", and
1166 "Tabulations", switches to the "Tagging" context.)
1168 Works like \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP but, unlike
1169 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP, the output depends on
1170 the order in which the words were tagged.
1171 In other words, the first tagged word comes first in the output, the
1172 second tagged word comes next, and so on.
1173 .IP "\fB-p\fP|\fB-at\fP|\fB-auto_tag\fP"
1174 (Allowed in the "Tagging" context.)
1176 This option modifies the default behavior of the
1177 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP
1178 and \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP options.
1180 An untagged word under the cursor will be automatically tagged when
1181 \fBENTER\fP is pressed.
1182 .IP "\fB-0\fP|\fB-noat\fP|\fB-no_auto_tag\fP"
1183 (Allowed in the "Tagging" context.)
1185 This option modifies the default behavior of the
1186 \fB-T\fP|\fB-tm\fP|\fB-tag\fP|\fB-tag_mode\fP
1187 and \fB-P\fP|\fB-pm\fP|\fB-pin\fP|\fB-pin_mode\fP options.
1189 An untagged word under the cursor will \fBnot\fP be automatically tagged
1190 when \fBENTER\fP is pressed \fBand\fP no other words are tagged.
1191 This is true even when the option \fB-p\fP|\fB-at\fP|\fB-auto_tag\fP is
1192 also set.
1194 It is ignored if at least one other word is tagged at that time.
1195 .IP "\fB-N\fP|\fB-number\fP>da_ctx... [\fIregex\fP]"
1196 (Allowed in the following contexts: "Main", "Columns", "Lines" and
1197 "Tabulation".)
1199 This option allows you to number selectable words that match a specific
1200 regular expression.
1201 These numbers are numbered from 1 and allow direct access to the words.
1203 To use this functionality, the user must enter the number which
1204 corresponds to the desired entry digit per digit.
1206 Each new digit must be added in a time frame of 1/2 seconds (per default)
1207 otherwise the number is considered complete and a newly entered digit
1208 will start a new number.
1209 If the number does not exists, then the cursor is restored to it's
1210 initial position.
1212 The sub-options of the \fB-D\fP|\fB-data\fP|\fB-options\fP option
1213 described below can change the way \fB-N\fP|\fB-number\fP sets and
1214 formats the numbers.
1216 This option accepts more than one argument and can be used multiple
1217 times with cumulative effects.
1219 \fB-N\fP|\fB-number\fP, \fB-U\fP|\fB-unnumber\fP and
1220 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP can be mixed.
1221 .IP "\fB-U\fP|\fB-unnumber\fP>da_ctx... [\fIregex\fP]"
1222 (Allowed in the following contexts: "Main", "Columns", "Lines" and
1223 "Tabulation".)
1225 This option allows one to unnumber words.
1226 If placed after a previous \fB-N\fP|\fB-number\fP, it can be used to
1227 remove the numbering of selected words.
1228 If placed before, the word which doesn't match its regular expression
1229 will be numbered by default.
1231 This mechanism is similar to to the inclusion/exclusion of words by
1232 \fB-i\fP|\fB-in\fP|\fB-inc\fP|\fB-incl\fP|\fB-include\fP and
1233 \fB-e\fP|\fB-ex\fP|\fB-exc\fP|\fB-excl\fP|\fB-exclude\fP.
1235 This option accepts more than one argument and can be used multiple
1236 times with cumulative effects.
1238 \fB-U\fP|\fB-unnumber\fP, \fB-N\fP|\fB-number\fP and
1239 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP can be mixed.
1240 .IP "\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP"
1241 (Allowed in the following contexts: "Main", "Columns", "Lines" and
1242 "Tabulation".)
1244 This option is similar to \fB-N\fP|\fB-number\fP but does not generate
1245 a continuous flow of numbers but extracts them from the word itself.
1247 With this option you can take full control of the numbering of the
1248 displayed word.
1249 Note that the numbering does not need to be ordered.
1251 The resulting word after the extraction of the number must be non empty.
1253 Some sub-option are required, see the \fB-D\fP|\fB-data\fP|\fB-options\fP
1254 option described below.
1256 \fBNotice\fP that for this option to work correctly, all the embedded
1257 numbers must have the same number of digits.
1258 To get that, a preprocessing may be necessary on the words before using
1259 this program.
1261 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \fB-N\fP|\fB-number\fP and
1262 \fB-U\fP|\fB-unnumber\fP can be mixed.
1263 .IP "\fB-D\fP|\fB-data\fP|\fB-options\fP [\fIparameter\fP...]"
1264 (Allowed in the Following contexts: "Main", "Columns", "Lines" and
1265 "Tabulations".)
1267 This option allows one to change the default behavior of
1268 the \fB-N\fP|\fB-number\fP, \fB-U\fP|\fB-unnumber\fP and
1269 \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP options.
1271 Its optional parameters are called sub-options and must respect the
1272 format \fBx\fP:\fBy\fP where \fBx\fP can be:
1275 \f(CBl\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1276 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1277 Here \fBy\fP is the \fBUTF-8\fP character (in native or \fI\\u\fP or
1278 \fI\\U\fP form) to print before the number.
1279 The default is a single space.
1281 Example:
1283 \f(CRecho test | smenu -N -D l:\\(\fP
1285 Will display: '\f(CB(1)\f(CR test\fR'
1288 \f(CBr\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1289 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1290 Here \fBy\fP is the \fBUTF-8\fP character (in native or \fI\\u\fP or
1291 \fI\\U\fP form) to print after the number.
1292 The default is \f(CB)\fP.
1294 Example:
1296 \f(CRecho test | smenu -N -D r:\\>\fP
1298 Will display: ' \f(CB1>\f(CR test\fR'
1301 \f(CBa\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1302 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1303 Here \fBy\fP is '\f(CBleft\fP' (or one of its prefixes) if the number
1304 must be \fIleft\fP aligned, or '\f(CBright\fP' (or one of its prefixes)
1305 if it must be \fIright\fP aligned.
1306 The default is \f(CBright\fP.
1308 Example:
1310 \f(CRecho test | smenu -N -D a:right w:3\fP
1312 Will display: '   \f(CB1)\f(CR test\fR'
1314 \f(CRecho test | smenu -N -D a:left w:3\fP
1316 Will display: ' \f(CB1  )\f(CR test\fR'
1319 \f(CBp\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1320 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1321 Here \fBy\fP is '\f(CBincluded\fP' or '\f(CBall\fP' for the initial
1322 \fIp\fPadding of the non numbered words.
1323 The keyword '\f(CBincluded\fP' means that only \fIincluded\fP word will
1324 be padded while '\f(CBall\fP' means pad \fIall\fP words.
1326 This sub-option may improve compactness when there is a lot of
1327 non-selectable words.
1329 The default is \f(CBall\fP. These keywords can be abbreviated.
1331 \fBWARNING\fP: in column/line/tab mode this sub-option is ignored and
1332 non numbered words are always padded.
1334 Example:
1336 \f(CRecho a b c | smenu -eb -N -D l:\\( p:a\fP
1338 Will display:
1339 \f(CB(1)\f(CR a     b \f(CB(2) c\fR
1342 \f(CRecho a b c | smenu -eb -N -D l:\\( p:i\fP
1344 Will display:
1345 \f(CB(1)\f(CR a b \f(CB(2) c\fR
1348 \f(CBw\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1349 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1350 Here \fBy\fP is the \fIw\fPidth of the number between 1 and 5 included.
1352 For an example, refer to the sub-option \fBa\fP above.
1355 \f(CBf\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1356 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1357 Here \fBy\fP controls if the numbering must \fIf\fPollow the last
1358 extracted number (defaults to \f(CByes\fP) or if it must remain
1359 independent.
1361 The possible values are \f(CByes\fP and \f(CBno\fP but can be abbreviated.
1363 Example:
1365 \f(CRecho 2a b c | smenu -F -D l:\\( f:n n:1 -N\fP
1367 Will display:
1368 \f(CB(2)\f(CR a \f(CB(1)\f(CR b \f(CB(2)\f(CR c\fR
1371 \f(CRecho 2a b c | smenu -F -D l:\\( f:y n:1 -N\fP
1373 Will display:
1374 \f(CB(2)\f(CR a \f(CB(3)\f(CR b \f(CB(4)\f(CR c\fR
1377 \f(CBm\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1378 Here \fBy\fP controls if the numbering of word with missing embedded numbers
1379 must be done or not (defaults to \f(CByes\fP).
1381 When this sub-option is set to \f(CBno\fP, the \f(CBs\fP and \f(CBf\fP
1382 sub-options are ignored.
1384 The possible values are \f(CByes\fP and \f(CBno\fP but can be abbreviated.
1386 Example:
1388 \f(CRecho 2a b c | smenu -F -D l:\\( n:1 m:n -N\fP
1390 Will display:
1391 \f(CB(2)\f(CR a     b     c\fR
1393 \f(CRecho 2a b c | smenu -F -D l:\\( n:1 m:y -N\fP
1395 Will display:
1396 \f(CB(2)\f(CR a \f(CB(3)\f(CR b \f(CB(4)\f(CR c\fR
1398 \f(CBh\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1399 Tells what to do with the characters present before the embedded number if
1400 any.
1402 The allowed directives are: '\f(CBtrim\fP' which discards them if they
1403 form an empty word (only made of spaces and tabulations), '\f(CBcut\fP'
1404 which unconditionally discards them and '\f(CBkeep\fP' which places them
1405 at the beginning of the resulting word.
1407 The default value for this directive is '\f(CBkeep\fP', these keywords
1408 can be abbreviated.
1410 Example:
1412 \f(CBecho \\" 2x\\" | smenu -F -D l:\\( o:1 n:1\fR
1414 Will display:
1416 \f(CB(2)\f(CR  x\fR
1417 \f(CR    ^^\fR
1418 \f(CB    \fRSelection cursor
1420 \f(CBecho \\" 2x\\" | smenu -F -D l:\\( o:1 n:1 h:t\fR
1422 Will display:
1424 \f(CB(2)\f(CR x\fR
1425 \f(CR    ^\fR
1426 \f(CB    \fRSelection cursor
1428 \f(CBecho \\"x2y\\" | smenu -F -D l:\\( o:1 n:1 h:c\fR
1430 Will display:
1432 \f(CB(2)\f(CR y\fR
1435 \f(CBo\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1436 Here \fBy\fP is the \fIo\fPffset of the first multibyte character of
1437 the number to extract from the word (defaults to \f(CB0\fP).
1439 If this offset if immediately followed by the character '\f(CB+\fP',
1440 then the parser will look for the first number (if any) after the given
1441 offset instead of using its absolute value to extract the number.
1443 Note that when the '\f(CB+\fP' is used, it is necessary that the length
1444 of all the numbers to extract have the same size as the algorithm looks
1445 for a digit to identify the beginning of the number to extract.
1446 Hence, for example, \fB1\fP should appear as \fB01\fP in the input is
1447 \f(CBn\fP is set to \f(CB2\fP.
1449 Example:
1451 \f(CBecho x2y xx3y | smenu -F -D l:\\( o:1+ n:1\fR
1453 will display:
1455 \f(CB(2)\f(CR xy \f(CB(3)\f(CR xxy\fR
1457 \f(CBecho x2y xx3y | smenu -F -D l:\\( o:1 n:1\fR
1459 will display (note the absence of the '\f(CB+\fP' character):
1461 \f(CB(2)\f(CR xy     xx3y\fR
1464 \f(CBn\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1465 Here \fBy\fP is the \fIn\fPumber of multibyte characters to extract
1466 from the word starting at the offset given by the \f(CBo\fP sub-option.
1468 Example: \f(CRn:2\fP will extract and use the first 2 digits of each
1469 words from the input stream to number them.
1472 \f(CBi\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP option)
1473 Here \fBy\fP is number of multibyte characters to \fIi\fPgnore after
1474 the extracted number
1477 \f(CBd\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1478 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1479 Here \fBy\fP is a multibyte separator.
1480 When present, this directive instructs smenu to output the selected
1481 numbered word(s) \fIprefixed\fP by its(their) direct access number(s)
1482 and the given separator.
1484 Only the numbered word(s) will be prefixed.
1486 \f(CBd\fP stands for \fBd\fPecorate.
1488 This directive can be useful when you want to post-process the output
1489 according to its direct access number.
1491 Example:
1493 \f(CBR=$(echo a b c | smenu -N -D d:-)\fR
1495 will display:
1497 \f(CB1)\f(CR a  \f(CB2)\f(CR b  \f(CB3)\f(CR c\fR
1499 The variable \f(CBR\fP will then contain the string \f(CB2-b\fP if
1500 \f(CBb\fP is selected.
1503 \f(CBs\fP (\fB-F\fP|\fB-en\fP|\fB-embedded_number\fP, \
1504 \fB-N\fP|\fB-number\fP and \fB-U\fP|\fB-unnumber\fP options)
1505 Here \fBy\fP is the direct access number that will be set for the first
1506 numbered word.
1507 Its value is \fB1\fP by default, a value of \fB0\fP is possible.
1509 Example:
1511 \f(CBecho a b c | smenu -N -D s:1000\fR
1513 will display:
1515 \f(CB1000)\f(CR a  \f(CB1001)\f(CR b  \f(CB1002) c\fR
1517 To number all words with the default parameters, use the
1518 syntax: "\f(CR-N\fP" which is a shortcut for:
1519 "\f(CR-N -D l:' ' r:')' a:r p:a\fP"
1521 When the \f(CBw\fP sub-option is not given, the width of the numbers is
1522 determined automatically but if \fB-F\fP|\fB-en\fP|\fB-embedded_number\fP
1523 is set and the value of the \f(CBn\fP sub-option is given then this
1524 value is used.
1526 .IP "\fB-b\fP|\fB-blank\fP"
1527 (Allowed in all contexts.)
1529 Replaces all non-printable characters by a blank.
1530 If this results in a blank word, it will be potentially deleted.
1531 .IP "\fB-.\fP|\fB-dot\fP|\fB-invalid\fP"
1532 (Allowed in all contexts.)
1534 Sets the substitution character for non-printable characters.
1535 When this parameter is not used, the default substitution character is
1536 a single dot.
1537 .IP "\fB-M\fP|\fB-middle\fP|\fB-center\fP"
1538 (Allowed in all contexts.)
1540 Centers the display if possible.
1541 .IP "\fB-d\fP|\fB-restore\fP|\fB-delete\fP|\fB-clean\fP|\fB-delete_window\fP|\
1542 \fB-clean_window\fP"
1543 (Allowed in all contexts.)
1545 Tells the program to clean up the display before quitting by removing
1546 the selection window after use as if it was never displayed.
1547 .IP "\fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP"
1548 (Allowed in the "Main" and "Tagging" contexts, switches to the "Columns"
1549 context.)
1551 Sets the column mode.
1552 In this mode the lines of words do not wrap when the right border of
1553 the terminal is reached but only when a special character is read.
1554 Some words will not be displayed without an horizontal scrolling.
1556 If such a scrolling is needed, some indications may appear on the left
1557 and right edge of the window to help the user to reach the unseen words.
1559 In this mode, the width of each column is minimal to keep the maximum
1560 information visible on the terminal.
1561 .IP "\fB-l\fP|\fB-line\fP|\fB-line_mode\fP"
1562 (Allowed in the "Main" and "Tagging" contexts, switches to the "Lines"
1563 context.)
1565 Sets the line mode.
1566 This mode is the same as column mode but without any column alignment.
1567 .IP "\fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP [\fIcols\fP]"
1568 (Allowed in the "Main" and "Tagging" contexts, switches to the
1569 "Tabulations" context.)
1571 This option sets the tabulation mode and, if a number is specified,
1572 attempts to set the number of displayed columns to that number.
1574 In this mode, embedded line separators are ignored if not explicitly set
1575 with \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP.
1576 The options \fB-A\fP|\fB-fc\fP|\fB-first_column\fP and
1577 \fB-Z\fP|\fB-lc\fP|\fB-last_column\fP can nevertheless be used to
1578 force words to appear in the first (respectively last) position of the
1579 displayed line.
1582 Note that the number of requested columns will be automatically reduced
1583 if a word does not fit in the calculated column size.
1585 In this mode each column has the same width.
1587 .IP "\fB-w\fP|\fB-wide\fP|\fB-wide_mode\fP"
1588 (Allowed in the "Columns" and "Tabulations" contexts.)
1590 When \fB-t\fP|\fB-tab\fP|\fB-tab_mode\fP|\fB-tabulate_mode\fP is followed
1591 by a number of columns, the default is to compact the columns so that they
1592 use the less terminal width as possible.
1593 This option enlarges the columns in order to use the whole terminal width.
1595 When in column mode, \fB-w\fP|\fB-wide\fP|\fB-wide_mode\fP can be used
1596 to force all the columns to have the same size (the largest one).
1597 See option \fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP below.
1600 Note that the column's size is only calculated once when the words are
1601 displayed for the first time.
1602 A terminal resize will not update this value.
1603 This choice enables a faster display.
1606 .IP "\fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP... \
1607 [\fIi\fP|\fII\fP|\fIe\fP|\fIE\fP|\
1608 \fIl\fP|\fIL\fP|\fIr\fP|\fIR\fP|\fIc\fP|\fIC\fP|\
1609 \fIa\fP|\fIA\fP]\
1610 [\fIselectors\fP]..."
1611 (Allowed in the "Columns" context.)
1613 In column mode, this option is useful for performing specific actions
1614 on a set of columns.
1616 These actions varies according to the directive given:
1618 - You can include (directive \fIi\fP or \fII\fP) or exclude (\fIe\fP or
1619 \fIE\fP) a set of selectable columns.
1621 - You can specified the kind of alignment (left, right or center) of the
1622 set of columns with the directives \fIl\fP, \fIL\fP, \fIr\fP, \fIR\fP,
1623 \fIc\fP or \fIC\fP.
1625 - You can also specified the attributes (colors...) of the set of columns
1626 with the directives \fIa\fP or \fIA\fP.
1628 When the directive is missing, the "include" directive is assumed
1629 (\fIi\fP).
1631 Note that it is best to use the lower case version of these directives,
1632 as their upper case alternative may have other meanings in the future.
1634 In selectors, columns can be designated by their number (starting with
1635 1) or by regular expressions surrounded by delimiters consisting of
1636 any printable ASCII character, except spaces and unprotected commas;
1637 commas can be protected by backslashes ('\fCD\\\fP')).
1639 Column ranges are defined  by separating their numbers with a dash. Open
1640 interval to the left or right are allowed, so these interval descriptions
1641 may be preceded or followed by a dash (e.g. \f(CB5-7\fP, \f(CB-2\fP
1642 or \f(CB8-\fP are allowed).
1644 \fBWARNING\fP: ranges of regular expressions are not yest supported.
1646 When using the \fIa\fP|\fIA\fP directive, an attribute \fBmust\fP be
1647 appended prefixed by a colon (':') as in \f(CB-C a1-2:6+b\fP per example.
1648 Refer to the attribute option (\fB-a\fP|\fB-attr\fP|\fB-attributes\fP)
1649 for more details.
1651 Multiple selectors can be regrouped in one argument using commas to
1652 separate them.
1654 This option also accepts multiple arguments, each of them being a
1655 selector.
1657 A selection by regular expressions means that a column containing a word
1658 matching any of these expressions will be included or excluded depending
1659 on the letter given after the option or before the selector if there is
1660 more than one argument.
1662 Regular expressions and column numbers can be freely mixed.
1664 This option also sets the default alignment of column contents when no
1665 arguments are provided.
1666 For example: \f(CB-Cr -Cl1\fP sets the default alignment to the right
1667 and the alignment of the contents of column 1 to the left.
1668 At the beginning, no default alignment of the column contents is set.
1670 Regular expression in \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1671 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP can contain \fBUTF-8\fP
1672 characters either directly or by using the \fI\\u\fP or \fI\\U\fP notation.
1674 Example of columns selection: \f(CB-Ci2,3,/X./,5-7\fP forces the cursor
1675 to only navigate in columns \fB2\fP,\fB3\fP,\fB5\fP,\fB6\fP and \fB7\fP
1676 and those containing a two characters word starting with '\fBX\fP'.
1677 If \fIe\fP was used in place of \fIi\fP, all the columns would have been
1678 selected \fBexcept\fP the columns \fB2\fP,\fB3\fP,\fB5\fP,\fB6\fP,\fB7\fP
1679 and those matching the extended regular expression '\f(CBX.\fP'.
1681 Example of defining the attributes of a column set:
1682 \f(CB-C a2-6:7/4+b\fP forces the columns from 2 to 6 to be bold and have
1683 a foreground color equal to 7 and a background color equal to 4.
1685 Example of mixing alignment and inclusion/exclusion directives:
1686 \f(CB-Ci1-5 -Ce/a+/ -Cr7,/b+/\fP makes columns 1 to 5 selectable, makes
1687 columns whose content starts with "a" non selectable and aligns the
1688 content of the column 7 to the left.
1690 Spaces are allowed in the selection string if they are protected.
1692 When an alignment directive is used and without any column selection,
1693 then the specified alignment becomes the default one, E.g: \f(CB-Cr\fP
1694 sets alignment the default one to the right.
1696 Other example where multiple selectors are used as multiple arguments:
1697 \f(CBps | smenu -col -cols e/TTY/ e/CMD/ e3\fP
1699 \fBWarning\fP, if this option appears on the command line before any
1700 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP option, the specified
1701 column alignments will be protected from any future row alignment
1702 directives.
1703 Otherwise row alignment directives will take precedence. For example:
1705 \f(CBecho "a b c\\\\naa bb cc\\\\naaaa bbbb cccc"
1706 | smenu -c -g\\| -C c2 -R r2\fP
1709 Gives:
1710 \f(CRa   | b  |c\fP
1711 \f(CR  aa| bb |  cc <-- \fPCol. 2 remains centered as \f(CB-C\fP was used first.
1712 \f(CRaaaa|bbbb|cccc\fP
1716 \f(CBecho "a b c\\\\naa bb cc\\\\naaaa bbbb cccc"
1717 | smenu -c -g\\| -R r2 -C c2\fP
1720 Gives:
1721 \f(CRa   | b  |c\fP
1722 \f(CR  aa|  bb|  cc <-- -R\fP takes precedence as it was used first.
1723 \f(CRaaaa|bbbb|cccc\fP
1725 .IP "\fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP... \fIselectors\fP..."
1726 (Allowed in the "Columns" and "Lines" contexts.)
1728 Similar to \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP but for
1729 the rows.
1731 \fBWarning\fP, the directives \fIl\fP, \fIL\fP, \fIr\fP, \fIR\fP, \fIc\fP
1732 and \fIC\fP are only allowed in column mode.
1734 \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1735 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP can be used more than
1736 once in a cumulative manner:
1738 The selection mode (selection or de-selection) is given by the first
1739 occurrence of the options, the other occurrences will only update the
1740 selected or de-selected ranges.
1742 Once a column or a row has been excluded, it cannot be re-included.
1743 .IP "\fB-al\fP|\fBalign\fP... \fIregex_selectors\fP..."
1744 (Allowed in the "Columns" context.)
1746 This option is similar to
1747 \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1748 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP but allows to
1749 align all words matched by on of the regular expression defined in
1750 \fIregex_selectors\fP
1752 This option only accepts a list of regular expressions.
1754 E.g.: \f(CB-al c/a+/,/b+/\fP
1756 \fB-al\fP|\fBalign\fP,
1757 \fB-C\fP|\fB-cs\fP|\fB-cols\fP|\fB-cols_select\fP and
1758 \fB-R\fP|\fB-rs\fP|\fB-rows\fP|\fB-rows_select\fP can be used more than
1759 once in a cumulative manner.
1761 Word alignments with this option take precedence over row and column
1762 alignments.
1763 .IP "\fB-A\fP|\fB-fc\fP|\fB-first_column\fP \fIregex\fP"
1764 (Allowed in the following contexts: "Columns", "Lines" and "Tabulations".)
1766 In column mode, forces all words matching the given regular expression
1767 to be the first one in the displayed line.
1768 If you want to only rely on this method to build the lines, just specify
1769 an empty \fBregex\fP to set the end-of-line separator with
1770 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP '')
1773 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp after
1774 \fB-A\fP|\fB-fc\fP|\fB-first_column\fP.
1776 .IP "\fB-Z\fP|\fB-lc\fP|\fB-last_column\fP \fIregex\fP"
1777 (Allowed in the following contexts: "Columns", "Lines" and "Tabulations".)
1779 Similar to \fB-A\fP|\fB-fc\fP|\fB-first_column\fP but forces the word
1780 to be the latest of its line.
1781 The same trick with
1782 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP
1783 can also be used.
1786 \fI\\u\fP and \fI\\U\fP sequences can also be used in the regexp after
1787 \fB-Z\fP|\fB-lc\fP|\fB-last_column\fP.
1789 .IP "\fB-g\fP|\fB-gutter\fP [\fIstring\fP]"
1790 (Allowed in the "Columns" and "Tabulations" contexts.)
1792 Replaces the blank after each words in column or tabular mode by a column
1793 separator.
1795 This separator is extracted from the \fIstring\fP argument and each
1796 of its (multibyte) character is used one after the other to fill
1797 the gutter.
1799 If there are more columns that gutter characters then the last character
1800 is used for the remaining columns.
1802 When not given, the separator defaults to a vertical bar \fI|\fP (or a
1803 full height vertical bar if the locale is set to \fBUTF-8\fP).
1805 Each character can be given in normal or \fI\\u\fP or \fI\\U\fP form in
1806 the \fIstring\fP argument.
1808 Example: "\f(CB|- \fP" will allow one to separate the first two columns
1809 with '\f(CB|\fP', then '\f(CB-\fP' will be used and '\f(CB \fP' will
1810 separate the remaining columns if any.
1811 .IP "\fB-k\fP|\fB-ks\fP|\fB-keep_spaces\fP"
1812 (Allowed in all contexts.)
1814 By default, the spaces surrounding the output string will be deleted.
1815 This option forces them to be retained.
1816 .IP "\fB-W\fP|\fB-ws\fP|\fB-wd\fP|\fB-word_delimiters\fP|\
1817 \fB-word_separators\fP \fIbytes\fP"
1818 (Allowed in all contexts.)
1820 This option can be used to specify the characters (or multibyte
1821 sequences) which will be used to delimit the input words.
1823 Each character or multibyte sequence in the given argument will be
1824 understood as a word delimiter.
1826 Multibyte sequences (\fBUTF-8\fP) can be natives of using the same ASCII
1827 representation used in words (a leading \fI\\u\fP or \fI\\U\fP following
1828 by up to 8 hexadecimal characters for the former and 6 hexadecimal
1829 characters for the latter).
1831 Non-printable characters in arguments should be given using the standard
1832 \fI$''\fP representation.
1833 \fI$'\\t'\fP stands for the tabulation character for example.
1835 The default delimiters are: \fISPACE\fP, \fI$'\\t'\fP and \fI$'\\n'\fP.
1836 .IP "\fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\
1837 \fB-line_separators\fP \fIbytes\fP"
1838 (Allowed in all contexts.)
1840 This option can be used to specify the characters (or multibyte
1841 sequences) which will be used to delimit the lines in the input stream.
1843 Each character or multibyte sequence in the given argument will be
1844 understood as a line delimiter.
1846 Multibyte sequences (\fBUTF-8\fP) can be natives of using the same ASCII
1847 representation used in words (a leading \fI\\u\fP or \fI\\U\fP following
1848 by up to 8 hexadecimal characters for the former and 6 hexadecimal
1849 characters for the latter).
1851 Non-printable characters in arguments should be given using the standard
1852 $'' representation.
1853 $'\\n' stands for the newline character for example.
1855 The default delimiter is: \fI$'\\n'\fP.
1857 This option is only useful when the
1858 \fB-c\fP|\fB-col\fP|\fB-col_mode\fP|\fB-column\fP or \fB-l\fP option is
1859 also set.
1861 The characters (or multibyte sequences) passed to
1862 \fB-L\fP|\fB-ls\fP|\fB-ld\fP|\fB-line-delimiters\fP|\fB-line_separators\fP are
1863 automatically added to the list of word delimiters as if
1864 \fB-W\fP|\fB-ws\fP|\fB-wd\fP|\fB-word_delimiters\fP|\fB-word_separators\fP was
1865 also used.
1867 \fI\\u\fP and \fI\\U\fP sequences can also be used here.
1869 .IP "\fB-q\fP|\fB-no_bar\fP|\fB-no_scroll_bar\fP"
1870 (Allowed in all contexts.)
1872 Prevents the display of the lateral scroll bar.
1873 This also prevents the display of the horizontal scroll bar.
1874 .IP "\fB-no_hbar\fP|\fB-no_hor_scroll_bar\fP"
1875 (Allowed in all contexts.)
1877 Prevents the display of the horizontal scroll bar.
1878 .IP "\fB-S\fP|\fB-subst\fP... \
1879 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1880 (Allowed in all contexts.)
1882 Post-processes the words by applying a regular expression based
1883 substitution.
1884 The argument must be formatted as in the \fBsed\fP editor.
1886 As in \fBsed\fP, matching groups and references to these groups
1887 (from \f(CB\\0\fP to \f(CB\\9\fP in \fIrepl\fP) are supported.
1888 These groups must be surrounded by \f(CB(\fP and \f(CB)\fP in \fIregex\fP.
1889 \f(CB\\0\fP and \f(CB&\fP are equivalent in \fIrepl\fP as in the GNU
1890 version of \fBsed\fP.
1892 Back reference example:
1895 \f(CBR=$(echo "[A] [B] [C]" | ./smenu -S '/([^][]+)/:\\1:/')\fP
1896 will display \f(CR"[:A:] [:B:] [:C:]"\fP
1899 This option can be used more than once.
1900 Each substitution will be applied in sequence on each word.
1901 This sequence can be stopped if a \fBstop\fP flag is encountered.
1904 \fBflags:\fP
1905 .IP \(bu 2
1906 The optional trailing \fBg\fP (for \fIg\fPlobal) means that all matching
1907 occurrences shall be replaced and not only the first one.
1908 .IP \(bu 2
1909 The optional trailing \fBv\fP (for \fIv\fPisual) means that the altered
1910 words will only be used for display and search.
1911 The modifications will \fInot\fP be reflected in the returned word.
1912 .IP \(bu 2
1913 The optional trailing \fBs\fP (for \fIs\fPtop) means that no
1914 more substitution will be allowed on this word even if another
1915 \fB-S\fP|\fB-subst\fP is used.
1916 .IP \(bu 2
1917 The optional trailing \fBi\fP (for \fIi\fPgnore case) means that the
1918 string search operation should ignore the case for this pattern.
1920 Small examples to explain the meaning of \fIv\fP:
1923 \f(CBR=$(echo a b c | smenu -S /b/B/)\fP
1925 will display \f(CR"a B c"\fP and \f(CBR\fP will contain \fIB\fP
1926 when \fIB\fP is selected meanwhile
1929 \f(CBR=$(echo a b c | smenu -S /b/B/\fBv\fP)\fR
1931 will display the same as above but \f(CBR\fP will contain the original
1932 word \fIb\fP when \fIB\fP is selected.
1934 In both cases, only the word \fIB\fP will be searchable and not \fIb\fP.
1936 .IP "\fB-I\fP|\fB-si\fP|\fB-subst_included\fP... \
1937 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1938 (Allowed in all contexts.)
1940 Post-processes the \fBselectable\fP words by applying a regular
1941 expression based substitution (see \fB-S\fP|\fB-subst\fP for details).
1942 .IP "\fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP... \
1943 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1944 (Allowed in all contexts.)
1946 Post-processes the \fBexcluded\fP (or \fBnon-selectable\fP)
1947 words by applying a regular expression based substitution (see
1948 \fB-S\fP|\fB-subst\fP for details).
1951 The \fB/\fP separator that \fB-I\fP|\fB-si\fP|\fB-subst_included\fP and
1952 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP are using above can be
1953 substituted by any other character except \fISPACE\fP, \fI\\t\fP,
1954 \fI\\f\fP, \fI\\n\fP, \fI\\r\fP and \fI\\v\fP.
1956 In the three previous options, \fIregex\fP is a \fBPOSIX\fP
1957 \fBE\fPxtended \fBR\fPegular \fBE\fPxpression.
1958 For details, please refer to the \fBregex(7)\fP manual page.
1960 Additionally \fI\\u\fP and \fI\\U\fP sequences can also be used in
1961 the regexp.
1964 If a post-processing action
1965 (\fB-S\fP|\fB-subst\fP, \fB-I\fP|\fB-si\fP|\fB-subst_included\fP, \
1966 \fB-E\fP|\fB-se\fP|\fB-subst_excluded\fP) results in an empty (length = 0)
1967 word, then we have two cases:
1969 .IP "in column mode:"
1970 Substitutions involving empty words can lead to misalignments, so it is
1971 necessary to prohibit them and terminate the program.
1972 These substitutions have to be made with other tools before using this
1973 utility.
1974 .IP "otherwise:"
1975 The word is simply removed.
1977 .IP "\fB-ES\fP|\fB-subst\fP... \
1978 /\fIregex\fP/\fIrepl\fP/[\fIg\fP][\fIv\fP][\fIs\fP]"
1979 (Allowed in all contexts.)
1981 Pre-processes words by applying a substitution based on a regular expression.
1982 The argument must be formatted as in the \fBsed\fP editor.
1984 The substitutions are made, as the name of the option indicates, before
1985 any other selection or coloring actions are made.
1987 This option can be used more than once.
1988 Each substitution will be applied in sequence on each word.
1989 This sequence can be stopped if a \fBstop\fP flag is encountered.
1991 In summary, this option is similar to the \fB-S\fP|\fB-subst\fP option
1992 previously described, except that the substitutions are made earlier and
1993 certain flags like \fBvisual\fP are ignored.
1995 Note that this option can be used in conjunction with the other
1996 substitution options mentioned above.
1997 .IP "\fB-/\fP|\fB-search_method\fP \fIsearch_method\fP"
1998 (Allowed in all contexts.)
2000 Affects the '\fB/\fP' key to a search method.
2001 By default '\fB/\fP' is affected to '\fIfuzzy\fP' but the argument can
2002 be any prefix of '\fIprefix\fP', '\fIsubstring\fP' or '\fIfuzzy\fP'.
2003 .IP "\fB-s\fP|\fB-sp\fP|\fB-start\fP|\fB-start_pattern\fP \fIpattern\fP"
2004 (Allowed in all contexts.)
2006 Place the cursor on the first word corresponding to the specified pattern.
2008 Note that although only the first matching word is highlighted,  all
2009 matching words (if any) can be accessed using \fBn\fP/\fBs\fP/\fBSPACE\fP
2010 and \fBN\fP/\fBS\fP keys as if they were the result of one of the
2011 search actions.
2013 These matching words can also be tagged at once if the tagging/pinning
2014 function is activated.  See the "Tagging" section for more information.
2016 \fBESC\fP can be used to disable navigation among matching words.
2018 \fIpattern\fP can be:
2020 .IP \(bu 2
2021 A \fB#\fP immediately followed by a \fBnumber\fP giving the initial
2022 position of the cursor (counting from 0).
2024 If the word at this position is excluded, then the first previous non
2025 excluded word is selected if it exists, otherwise the first non excluded
2026 word is selected.
2028 If this number if greater than the number of words, the cursor will be
2029 placed on the latest selectable position.
2030 .IP \(bu 2
2031 A single \fB#\fP or the string \fB#last\fP to set the initial
2032 cursor position on the latest selectable word position.
2033 .IP \(bu 2
2034 A string starting with a \fB/\fP indicating that we want the cursor
2035 to be placed on the first word matching the given regular expression.
2036 .IP \(bu 2
2037 A string starting with a \fB=\fP indicating than we want the cursor
2038 to be placed on that exact word.
2039 .IP \(bu 2
2040 A normal string. In this case the cursor will be placed on the
2041 first word starting with that string (\fBCa\fP will match \fBCancel\fP
2042 by example).
2044 \fBWarning\fP, when searching for a prefix or a regular expression, smenu
2045 only looks for them after an eventual modification, so for example,
2046 the command:
2047 \f(CBsmenu -I/c/x/ -s/c <<< "a b c d"\fP won't find c and put the cursor
2048 on \fBa\fP but \f(CBsmenu -I/c/x/v -s/c <<< "a b c d"\fP will find it and
2049 put the cursor on the \fBx\fP substituting the \fBc\fP on screen only
2051 \fI\\u\fP and \fI\\U\fP sequences can be used in the pattern.
2053 .IP "\fB-x\fP|\fB-tmout\fP|\fB-timeout\fP \fItype\fP [\fIword\fP] \fIdelay\fP"
2054 .IP "\fB-X\fP|\fB-htmout\fP|\fB-hidden_timeout\fP \fItype\fP [\fIword\fP]\
2055  \fIdelay\fP"
2056 (Allowed in all contexts.)
2058 Sets a timeout.
2059 Three types of timeout are possible:
2061 .TP 10
2062 current:
2063 At the timeout, the word under the cursor and/or the tagged words are
2064 sent to the standard output if the \fBENTER\fP key has been pressed
2065 .TP 10
2066 quit:
2067 At the timeout, nothing is selected as if the \fBq\fP key has been pressed
2068 .TP 10
2069 word:
2070 At the timeout, the word given after the type is selected.
2071 Note that this word doesn't need to be part of the words coming from
2072 the standard input.
2074 Each type can be be shortened as a prefix of its full name ("cur" for
2075 "current" of "q" for "quit" per example).
2077 The delay must be set in seconds and cannot be greater than 99999 seconds.
2079 The remaining time (in seconds) is added at the end of the message
2080 displayed above the selection window and is updated in real time each
2081 second.
2083 Any key except \fBENTER\fP, \fBq\fP, \fBQ\fP and \fBCTRL\ C\fP resets
2084 the timer to its initial value.
2086 The \fB-X\fP|\fB-htmout\fP|\fB-hidden_timeout\fP version works like
2087 \fB-x\fP|\fB-tmout\fP|\fB-timeout\fP but no periodic remaining messages
2088 is displayed above the selection window.
2090 .IP "\fB-r\fP|\fB-auto_validate\fP"
2091 (Allowed in all contexts.)
2093 Enables \fBENTER\fP to validate the selection even in search mode.
2094 .IP "\fB-is\fP|\fB-incremental_search\fP"
2095 (Allowed in all contexts.)
2097 By default, when a new search session is initiated, the current search
2098 buffer is reset.
2099 When this parameter is set, the next search will start where the last
2100 search ended, except if \fBESC\fP was hit before.
2102 This option instructs not to clean the previous search buffer each time
2103 a new search session is started.
2104 .IP "\fB-v\fP|\fB-vb\fP|\fB-visual_bell\fP"
2105 (Allowed in all contexts.)
2107 By default, when searching, an alarm is produced by the terminal when
2108 the user enters a character or makes a move which lead to no result or
2109 to an error condition.
2110 This argument make this beep visual by briefly showing the cursor.
2111 .IP "\fB-Q\fP|\fB-ignore_quotes\fP"
2112 (Allowed in all contexts.)
2114 Using this option will remove the word grouping feature from single and
2115 double quotes which will be considered normal characters.
2116 For example: \f(CB"a b"\fP will be considered by smenu as two words
2117 \fB"a\fP and \fBb"\fP and no more as a single word: \fBa b\fP.
2118 .IP "\fB-lim\fP|\fB-limits\fP \fIlimit:value\fP..."
2119 (Allowed in all contexts.)
2121 This option gives the possibility to modify the default maximum number
2122 of words or columns and the maximum permitted word length.
2124 The specified values overload the default settings and/or the settings
2125 given in the configuration files.
2128 In order to do that, three sub-options can be used:
2129 .IP \fBl\fP:value 2
2130 to set the maximum word length allowed.
2131 .IP \fBw\fP:value 2
2132 to set the maximum number of words allowed.
2133 .IP \fBc\fP:value 2
2134 to set the maximum number of columns allowed.
2136 Several sub-options, separated by spaces, can be given after this option.
2139 .IP "\fB-f\fP|\fB-forgotten_timeout\fP|\fB-global_timeout\fP \fItimeout\fP"
2140 (Allowed in all contexts.)
2142 This option defines a global timeout in seconds.
2143 The program will end without error after this period of inactivity.
2145 This timer is reset to its initial value each time a key is pressed.
2147 Its default value is "unlimited", but it can be changed by assigning a
2148 number (in tenths of seconds) to the "forgotten" entry in the [timers]
2149 section of the optional configuration file.
2150 See the example in the configuration sub-section.
2152 A \fItimeout\fP value equals to \fB0\fP explicitly disables this timer.
2153 .IP "\fB-nm\fP|\fB-no_mouse\fP"
2154 (Allowed in all contexts.)
2156 This option allows you to disable the mouse even if smenu can use it.
2157 .IP "\fB-br\fP|\fB-buttons\fP|\fB-button_remapping\fP \fInew_button_1\fP \
2158 \fInew_button_3\fP"
2159 (Allowed in all contexts.)
2161 This option allows one to remap the mouse buttons.  The buttons are numbered
2162 from 1 to 3 but as smenu only uses buttons 1 and 3, only two arguments
2163 are required.
2165 By example, the syntax \f(CR-br 3 1\fP will reverse the first (left)
2166 and third (right?) buttons.
2168 The default mapping is \f(CR1 3\fP.
2169 .IP "\fB-dc\fP|\fB-dcd\fP|\fB-double_click\fP|\fB-double_click_delay\fP \
2170 \fIdelay_in_ms\fP"
2171 (Allowed in all contexts.)
2173 This option allows one to set the double-click delay in the range of 100 ms
2174 (1/10 second) to 500 ms (1/2 second).
2175 The default delay of 150 ms (1/6.66 second) will be used if the given
2176 value is out of range or invalid.
2178 The double-click capability can also be disabled by setting
2179 \fIdelay_in_ms\fP to \fB0\fP.
2181 This setting is also configurable in a configuration file, see the
2182 [mouse] section in the example in the configuration sub-section.
2183 .IP "\fB-sb\fP|\fB-sbw\fP|\fB-show_blank_words\fP [\fIblank_char\fP]"
2184 (Allowed in all contexts.)
2186 Normally, blank words (words containing only space:.!fmt
2187 s) are only kept in column mode.
2188 When this option is present, these words are converted into a sequence
2189 of \fIblank_char\fP (or underscore if the optional parameter is absent)
2190 so that they are visible and not ignored when not in column mode.
2192 \fIblank_char\fP must be printable but not a space nor a multibyte
2193 character.
2195 Note: These blank words remain blank even if they are now made
2196 visible. They can still be excluded using \f(CB-e '\ '\fP
2197 or \f(CB-e '[ ]'\fP per example.
2198 .SH NOTES
2199 If tabulators (\fI\\t\fP) are embedded in the input, there is no way
2200 to replace them with the original number of spaces.
2201 In this case use another filter (like \fIexpand\fR) to pre-process
2202 the data.
2203 .SH EXAMPLES
2204 .SS 1
2205 Simple Yes/No/Cancel request with "No" as default choice:
2208 \f(CRIn \fBbash\fP:
2209   \f(CBread R <<< $(echo "Yes No Cancel" \\
2210                | smenu  -d -m "Please choose:" -s /N)\fP
2213   \f(CBR=$(echo "Yes No Cancel" \\
2214       | smenu -d -m "Please choose:" -s /N)\fP
2216 In \fBksh\fP:
2217   \f(CBprint "Yes No Cancel"                \\
2218   | smenu -d -m "Please choose:" -s /N \\
2219   | read R\fP
2222 .SS 2
2223 Get a 3 columns report about VM statistics for the current process in
2224 \fBbash\fP/\fBksh\fP on Linux:
2227 \f(CBR=$(grep Vm /proc/$$/status | expand | smenu -b -W$'\\n' -t3 -g -d)\fB
2231 .SS 3
2232 Create a one column selection window containing the list of the first
2233 20 LVM physical volumes.
2234 At the end, the selection window will be erased.
2235 This example is written in \fBksh\fP).
2238 \f(CB
2239 pvs -a -o pv_name --noheadings                 \\
2240 | smenu -m "PV list" -n20 -t1 -d -s //dev/root \\
2241 | read R
2245 The display will have a look similar to the following with the cursor
2246 set on the word \fI/dev/root\fP:
2249 \f(CRPV list
2250 /dev/md126           \\
2251 /dev/md127           |
2252 /dev/root            | <- cursor here.
2253 /dev/sda2            |
2254 /dev/sdb2            |
2255 /dev/sdc1            |
2256 /dev/sdc2            |
2257 /dev/system/homevol  /
2260 .SS "4 (advanced)"
2261 Imagine a file named \fBsample.mnu\fP with the following content:
2264 \f(CR--8<---------------------------------
2265 "1 First Entry" "3 Third entry"
2266 "2 Second entry" "4 Fourth entry"
2267 @@@ "5 Fifth entry"
2269 "0 Exit menu"
2270 --8<---------------------------------
2274 Then this quite esoteric command will render it (centered on the screen) as:
2277 \f(CR+----------------------------------+
2278 |            Test menu             |
2279 |                                  |
2280 | 1) First Entry   3) Third entry  |
2281 | 2) Second entry  4) Fourth entry |
2282 |                  5) Fifth entry  |
2283 |                                  |
2284 | 0) Exit menu                     |
2285 +----------------------------------+
2289 with the cursor on \fIQuit\fP and only the numbers and "Quit" selectable.
2291 \f(CBR=$(smenu -q -d -s/Exit -M -n 30 -c        \\
2292           -e "@+" -E '/@+/ /'              \\
2293           -F -D n:1 i:1                    \\
2294           -m "Test menu" < sample.mnu)
2296 The selected entry will be available in \f(CBR\fP
2298 Try to understand it as an exercise.
2299 .SH ENVIRONMENT
2301 tab(@);
2302 l l.
2303 \fINO_COLOR\fP@force a monochrome terminal when set.
2304 \fICTXOPT_DEBUG\fP@put the option parser in debug mode.
2306 .SH BUGS/LIMITATIONS
2307 Some terminal emulators, those notably based on VTE version later than
2308 0.35 (see https://github.com/GNOME/vte/commit/01380d), have a new feature
2309 that gives them the possibility to wrap/unwrap already displayed lines
2310 when resizing the window.
2312 As far as I known, there is no terminfo entry to disable that.
2314 On these types of terminals, the automatic re-display of the output of
2315 smenu will be disturbed and some artifacts may appear on the screen if
2316 the terminal window is resized.
2317 .SH AUTHORS
2318 \(co 2015-present, Pierre Gentile (p.gen.progs@gmail.com)