1tabs(1)                     General Commands Manual                    tabs(1)
2
3
4

NAME

6       tabs - set tabs on a terminal
7

SYNOPSIS

9       tabs [options]] [tabstop-list]
10

DESCRIPTION

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

OPTIONS

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       POSIX defines several predefined lists of tab stops.
85
86       -a   Assembler, IBM S/370, first format
87            1,10,16,36,72
88
89       -a2  Assembler, IBM S/370, second format
90            1,10,16,40,72
91
92       -c   COBOL, normal format
93            1,8,12,16,20,55
94
95       -c2  COBOL compact format
96            1,6,10,14,49
97
98       -c3  COBOL compact format extended
99            1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67
100
101       -f   FORTRAN
102            1,7,11,15,19,23
103
104       -p   PL/I
105            1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61
106
107       -s   SNOBOL
108            1,10,55
109
110       -u   UNIVAC 1100 Assembler
111            1,12,20,44
112
113   Margins
114       A few terminals provide the capability for  changing  their  left/right
115       margins.  The tabs program has an option to use this feature:
116
117       +m margin
118            The effect depends on whether the terminal has the margin capabil‐
119            ities:
120
121            •   If the terminal provides the capability for setting  the  left
122                margin,  tabs  uses  this, and adjusts the available width for
123                tab-stops.
124
125            •   If the terminal does not provide the margin capabilities, tabs
126                imitates  the effect, putting the tab stops at the appropriate
127                place on each line.  The terminal's left-margin is  not  modi‐
128                fied.
129
130            If the margin parameter is omitted, the default is 10.  Use +m0 to
131            reset the left margin, i.e., to the left edge  of  the  terminal's
132            display.   Before setting a left-margin, tabs resets the margin to
133            reduce problems which might arise on moving the cursor before  the
134            current left-margin.
135
136       When  setting  or  resetting the left-margin, tabs may reset the right-
137       margin.
138

PORTABILITY

140       IEEE  Std  1003.1/The  Open   Group   Base   Specifications   Issue   7
141       (POSIX.1-2008) describes a tabs utility.  However
142
143       •   This  standard describes a +m option, to set a terminal's left-mar‐
144           gin.  Very few of the entries in the terminal database provide  the
145           smgl  (set_left_margin)  or smglp (set_left_margin_parm) capability
146           needed to support the feature.
147
148       •   There is no counterpart in X/Open Curses Issue 7 for this  utility,
149           unlike tput(1).
150
151       The  -d  (debug)  and -n (no-op) options are extensions not provided by
152       other implementations.
153
154       A tabs utility appeared in PWB/Unix 1.0 (1977).  There  was  a  reduced
155       version  of  the  tabs  utility in Unix 7th edition and in 3BSD (1979).
156       The latter supported a single “-n” option (to cause the first tab  stop
157       to be set on the left margin).  That option is not documented by POSIX.
158
159       The  PWB/Unix  tabs  utility,  which was included in System III (1980),
160       used built-in tables rather than the terminal database,  to  support  a
161       half-dozen  hardcopy  terminal  (printer)  types.  It also had built-in
162       logic to support the left-margin, as well as a feature for copying  the
163       tab settings from a file.
164
165       Later  versions  of  Unix,  e.g.,  SVr4, added support for the terminal
166       database, but kept the tables to support the printers.  In  an  earlier
167       development effort, the tab-stop initialization provided by tset (1982)
168       and incorporated into tput uses the terminal database,
169
170       The +m option  was  documented  in  the  Base  Specifications  Issue  5
171       (Unix98, 1997), and omitted in Issue 6 (Unix03, 2004) without document‐
172       ing the rationale, though an introductory comment “and  optionally  ad‐
173       justs  the  margin” remains, overlooked in the removal.  The documented
174       tabs utility in Issues 6 and later has no mechanism  for  setting  mar‐
175       gins.  The +m option in this implementation differs from the feature in
176       SVr4 by using terminal capabilities rather than built-in tables.
177
178       POSIX documents no limits on the number of  tab  stops.   Documentation
179       for other implementations states that there is a limit on the number of
180       tab stops (e.g., 20 in PWB/Unix's tabs utility).  While some  terminals
181       may  not  accept  an arbitrary number of tab stops, this implementation
182       will attempt to set tab stops up to the right margin of the screen,  if
183       the given list happens to be that long.
184
185       The  Rationale section of the POSIX documentation goes into some detail
186       about the ways the committee considered redesigning the tabs  and  tput
187       utilities, without proposing an improved solution.  It comments that
188
189            no  known  historical  version  of tabs supports the capability of
190            setting arbitrary tab stops.
191
192       However, the Explicit Lists described in this manual page  were  imple‐
193       mented  in  PWB/Unix.  Those provide the capability of setting abitrary
194       tab stops.
195

SEE ALSO

197       infocmp(1M), tset(1), curses(3X), terminfo(5).
198
199       This describes ncurses version 6.4 (patch 20230520).
200
201
202
203                                                                       tabs(1)
Impressum