1 .\"***************************************************************************
2 .\" Copyright 2018-2021,2023 Thomas E. Dickey *
3 .\" Copyright 2008-2016,2017 Free Software Foundation, Inc. *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a *
6 .\" copy of this software and associated documentation files (the *
7 .\" "Software"), to deal in the Software without restriction, including *
8 .\" without limitation the rights to use, copy, modify, merge, publish, *
9 .\" distribute, distribute with modifications, sublicense, and/or sell *
10 .\" copies of the Software, and to permit persons to whom the Software is *
11 .\" furnished to do so, subject to the following conditions: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 .\" Except as contained in this notice, the name(s) of the above copyright *
25 .\" holders shall not be used in advertising or otherwise to promote the *
26 .\" sale, use or other dealings in this Software without prior written *
28 .\"***************************************************************************
30 .\" $Id: tabs.1,v 1.48 2023/10/14 19:29:06 tom Exp $
31 .TH @TABS@ 1 2023-10-14 "ncurses 6.4" "User commands"
51 set terminal tab stops
53 \fB@TABS@\fP [\fIoptions\fP]] \fI[tabstop-list]\fP
55 The \fB@TABS@\fP program clears and sets tab-stops on the terminal.
56 This uses the terminfo \fBclear_all_tabs\fP and \fBset_tab\fP capabilities.
57 If either is absent, \fB@TABS@\fP is unable to clear/set tab-stops.
58 The terminal should be configured to use hard tabs, e.g.,
66 Like \fB@CLEAR@\fP(1), \fB@TABS@\fP writes to the standard output.
67 You can redirect the standard output to a file (which prevents
68 \fB@TABS@\fP from actually changing the tabstops),
69 and later \fBcat\fP the file to the screen, setting tabstops at that point.
71 These are hardware tabs, which cannot be queried rapidly by applications
72 running in the terminal, if at all.
73 Curses and other full-screen applications may use hardware tabs
74 in optimizing their output to the terminal.
75 If the hardware tabstops differ from the information in the terminal
76 database, the result is unpredictable.
77 Before running curses programs,
78 you should either reset tab-stops to the standard interval
86 or use the \fB@RESET@\fP program,
87 since the normal initialization sequences do not ensure that tab-stops
93 Tell \fB@TABS@\fP which terminal type to use.
94 If this option is not given, \fB@TABS@\fP will use the \fB$TERM\fP
96 If that is not set, it will use the \fIansi+tabs\fP entry.
99 The debugging option shows a ruler line, followed by two data lines.
100 The first data line shows the expected tab-stops marked with asterisks.
101 The second data line shows the actual tab-stops, marked with asterisks.
104 This option tells \fB@TABS@\fP to check the options and run any debugging
105 option, but not to modify the terminal settings.
108 reports the version of ncurses which was used in this program, and exits.
110 The \fB@TABS@\fP program processes a single list of tab stops.
111 The last option to be processed which defines a list is the one that
112 determines the list to be processed.
114 Use a single number as an option,
115 e.g., \*(``\fB\-5\fP\*('' to set tabs at the given
116 interval (in this case 1, 6, 11, 16, 21, etc.).
117 Tabs are repeated up to the right margin of the screen.
119 Use \*(``\fB\-0\fP\*('' to clear all tabs.
121 Use \*(``\fB\-8\fP\*('' to set tabs to the standard interval.
123 An explicit list can be defined after the options
124 (this does not use a \*(``\-\*('').
125 The values in the list must be in increasing numeric order,
126 and greater than zero.
127 They are separated by a comma or a blank, for example,
136 Use a \*(``+\*('' to treat a number
137 as an increment relative to the previous value,
146 which is equivalent to the 1,6,11,16,21 example.
147 .SS Predefined Tab-Stops
148 POSIX defines several predefined lists of tab stops.
151 Assembler, IBM S/370, first format
156 Assembler, IBM S/370, second format
171 COBOL compact format extended
173 1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67
183 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61
191 UNIVAC 1100 Assembler
195 A few terminals provide the capability for changing their left/right margins.
196 The @TABS@ program has an option to use this feature:
199 The effect depends on whether the terminal has the margin capabilities:
202 If the terminal provides the capability for setting the left margin,
203 @TABS@ uses this, and adjusts the available width for tab-stops.
205 If the terminal does not provide the margin capabilities,
206 @TABS@ imitates the effect, putting the tab stops at the appropriate
208 The terminal's left-margin is not modified.
211 If the \fImargin\fP parameter is omitted, the default is 10.
212 Use \fB+m0\fP to reset the left margin,
213 i.e., to the left edge of the terminal's display.
214 Before setting a left-margin,
215 @TABS@ resets the margin to reduce problems which might arise
216 on moving the cursor before the current left-margin.
218 When setting or resetting the left-margin,
219 @TABS@ may reset the right-margin.
223 tab stop initialization database
225 \fIIEEE Std 1003.1/The Open Group Base Specifications Issue 7\fP (POSIX.1-2008)
226 describes a \fBtabs\fP utility.
229 This standard describes a \fB+m\fP option, to set a terminal's left-margin.
230 Very few of the entries in the terminal database provide the
231 \fBsmgl\fP (\fBset_left_margin\fP) or
232 \fBsmglp\fP (\fBset_left_margin_parm\fP)
233 capability needed to support the feature.
235 There is no counterpart in X/Open Curses Issue 7 for this utility,
236 unlike \fB@TPUT@\fP(1).
238 The \fB\-d\fP (debug) and \fB\-n\fP (no-op) options are extensions not provided
239 by other implementations.
241 A \fBtabs\fP utility appeared in PWB/Unix 1.0 (1977).
242 There was a reduced version of the \fBtabs\fP utility
243 in Unix 7th edition and in 3BSD (1979).
244 The latter supported a single \*(``\-n\*('' option
245 (to cause the first tab stop to be set on the left margin).
246 That option is not documented by POSIX.
248 The PWB/Unix \fBtabs\fP utility, which was included in System III (1980),
249 used built-in tables rather than the terminal database,
250 to support a half-dozen hardcopy terminal (printer) types.
251 It also had built-in logic to support the left-margin,
252 as well as a feature for copying the tab settings from a file.
254 Later versions of Unix, e.g., SVr4,
255 added support for the terminal database,
256 but kept the tables to support the printers.
257 In an earlier development effort,
258 the tab-stop initialization provided by \fBtset\fP (1982)
259 and incorporated into \fBtput\fP uses the terminal database,
261 The \fB+m\fP option was documented
262 in the Base Specifications Issue 5 (Unix98, 1997),
263 and omitted in Issue 6 (Unix03, 2004) without documenting the rationale,
264 though an introductory comment
265 \fI\*(``and optionally adjusts the margin\*(''\fP remains,
266 overlooked in the removal.
267 The documented \fBtabs\fP utility in Issues 6 and later has no mechanism
269 The \fB+m\fP option in this implementation differs from the feature
270 in SVr4 by using terminal capabilities rather than built-in tables.
272 POSIX documents no limits on the number of tab stops.
273 Documentation for other implementations states that there is a limit on the
275 (e.g., 20 in PWB/Unix's \fBtabs\fP utility).
276 While some terminals may not accept an arbitrary number
277 of tab stops, this implementation will attempt to set tab stops up to the
278 right margin of the screen, if the given list happens to be that long.
280 The \fIRationale\fP section of the POSIX documentation goes into some
281 detail about the ways the committee considered redesigning the
282 \fBtabs\fP and \fBtput\fP utilities,
283 without proposing an improved solution.
287 no known historical version of tabs supports the capability of setting
291 However, the \fIExplicit Lists\fP described in this manual page
292 were implemented in PWB/Unix.
293 Those provide the capability of setting abitrary tab stops.
295 \fB\%@INFOCMP@\fP(1M),
298 \fB\%terminfo\fP(\*n)