1tabs(1) General Commands Manual tabs(1)
2
3
4
6 tabs - set tabs on a terminal
7
9 tabs [options]] [tabstop-list]
10
12 The tabs program clears and sets tab-stops on the terminal. This uses
13 the terminfo clear_all_tabs and set_tab capabilities. If either is ab‐
14 sent, tabs is unable to clear/set tab-stops. The terminal should be
15 configured to use hard tabs, e.g.,
16
17 stty tab0
18
19 Like clear(1), tabs writes to the standard output. You can redirect
20 the standard output to a file (which prevents tabs from actually chang‐
21 ing the tabstops), and later cat the file to the screen, setting tab‐
22 stops at that point.
23
24 These are hardware tabs, which cannot be queried rapidly by applica‐
25 tions running in the terminal, if at all. Curses and other full-screen
26 applications may use hardware tabs in optimizing their output to the
27 terminal. If the hardware tabstops differ from the information in the
28 terminal database, the result is unpredictable. Before running curses
29 programs, you should either reset tab-stops to the standard interval
30
31 tabs -8
32
33 or use the reset program, since the normal initialization sequences do
34 not ensure that tab-stops are reset.
35
37 General Options
38 -Tname
39 Tell tabs which terminal type to use. If this option is not
40 given, tabs will use the $TERM environment variable. If that is
41 not set, it will use the ansi+tabs entry.
42
43 -d The debugging option shows a ruler line, followed by two data
44 lines. The first data line shows the expected tab-stops marked
45 with asterisks. The second data line shows the actual tab-stops,
46 marked with asterisks.
47
48 -n This option tells tabs to check the options and run any debugging
49 option, but not to modify the terminal settings.
50
51 -V reports the version of ncurses which was used in this program, and
52 exits.
53
54 The tabs program processes a single list of tab stops. The last option
55 to be processed which defines a list is the one that determines the
56 list to be processed.
57
58 Implicit Lists
59 Use a single number as an option, e.g., “-5” to set tabs at the given
60 interval (in this case 1, 6, 11, 16, 21, etc.). Tabs are repeated up
61 to the right margin of the screen.
62
63 Use “-0” to clear all tabs.
64
65 Use “-8” to set tabs to the standard interval.
66
67 Explicit Lists
68 An explicit list can be defined after the options (this does not use a
69 “-”). The values in the list must be in increasing numeric order, and
70 greater than zero. They are separated by a comma or a blank, for exam‐
71 ple,
72
73 tabs 1,6,11,16,21
74 tabs 1 6 11 16 21
75
76 Use a “+” to treat a number as an increment relative to the previous
77 value, e.g.,
78
79 tabs 1,+5,+5,+5,+5
80
81 which is equivalent to the 1,6,11,16,21 example.
82
83 Predefined Tab-Stops
84 X/Open defines several predefined lists of tab stops.
85
86 -a Assembler, IBM S/370, first format
87
88 -a2 Assembler, IBM S/370, second format
89
90 -c COBOL, normal format
91
92 -c2 COBOL compact format
93
94 -c3 COBOL compact format extended
95
96 -f FORTRAN
97
98 -p PL/I
99
100 -s SNOBOL
101
102 -u UNIVAC 1100 Assembler
103
105 IEEE Std 1003.1/The Open Group Base Specifications Issue 7
106 (POSIX.1-2008) describes a tabs utility. However
107
108 • This standard describes a +m option, to set a terminal's left-mar‐
109 gin. Very few of the entries in the terminal database provide the
110 smgl (set_left_margin) or smglp (set_left_margin_parm) capability
111 needed to support the feature.
112
113 • There is no counterpart in X/Open Curses Issue 7 for this utility,
114 unlike tput(1).
115
116 The -d (debug) and -n (no-op) options are extensions not provided by
117 other implementations.
118
119 A tabs utility appeared in PWB/Unix 1.0 (1977). There was a reduced
120 version of the tabs utility in Unix 7th edition and in 3BSD (1979).
121 The latter supported a single “-n” option (to cause the first tab stop
122 to be set on the left margin). That option is not documented by POSIX.
123
124 The PWB/Unix tabs utility, which was included in System III (1980),
125 used built-in tables rather than the terminal database, to support a
126 half-dozen terminal types. It also had built-in logic to support the
127 left-margin, as well as a feature for copying the tab settings from a
128 file.
129
130 Later versions of Unix, e.g., SVr4, added support for the terminal
131 database, but kept the tables, as a fallback. In an earlier develop‐
132 ment effort, the tab-stop initialization provided by tset (1982) and
133 incorporated into tput uses the terminal database,
134
135 POSIX documents no limits on the number of tab stops. Documentation
136 for other implementations states that there is a limit on the number of
137 tab stops (e.g., 20 in PWB/Unix's tabs utility). While some terminals
138 may not accept an arbitrary number of tab stops, this implementation
139 will attempt to set tab stops up to the right margin of the screen, if
140 the given list happens to be that long.
141
142 The Rationale section of the POSIX documentation goes into some detail
143 about the ways the committee considered redesigning the tabs and tput
144 utilities, without proposing an improved solution. It comments that
145
146 no known historical version of tabs supports the capability of
147 setting arbitrary tab stops.
148
149 However, the Explicit Lists described in this manual page were imple‐
150 mented in PWB/Unix. Those provide the capability of setting abitrary
151 tab stops.
152
154 infocmp(1M), tset(1), curses(3X), terminfo(5).
155
156 This describes ncurses version 6.2 (patch 20210508).
157
158
159
160 tabs(1)