]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tabs.1
ncurses 6.2 - patch 20200314
[ncurses.git] / man / tabs.1
1 .\"***************************************************************************
2 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
3 .\" Copyright 2008-2016,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
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:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
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.                               *
23 .\"                                                                          *
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       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: tabs.1,v 1.27 2020/02/02 23:34:34 tom Exp $
31 .TH @TABS@ 1 ""
32 .ds n 5
33 .ie \n(.g .ds `` \(lq
34 .el       .ds `` ``
35 .ie \n(.g .ds '' \(rq
36 .el       .ds '' ''
37 .de bP
38 .ie n  .IP \(bu 4
39 .el    .IP \(bu 2
40 ..
41 .de NS
42 .ie n  .sp
43 .el    .sp .5
44 .ie n  .in +4
45 .el    .in +2
46 .nf
47 .ft C                   \" Courier
48 ..
49 .de NE
50 .fi
51 .ft R
52 .ie n  .in -4
53 .el    .in -2
54 ..
55 .SH NAME
56 \fB@TABS@\fR \- set tabs on a terminal
57 .SH SYNOPSIS
58 \fB@TABS@\fR [\fIoptions\fR]] \fI[tabstop-list]\fR
59 .SH DESCRIPTION
60 .PP
61 The \fB@TABS@\fP program clears and sets tab-stops on the terminal.
62 This uses the terminfo \fIclear_all_tabs\fP and \fIset_tab\fP capabilities.
63 If either is absent, \fB@TABS@\fP is unable to clear/set tab-stops.
64 The terminal should be configured to use hard tabs, e.g.,
65 .NS
66 stty tab0
67 .NE
68 .PP
69 Like \fB@CLEAR@\fR(1), \fB@TABS@\fR writes to the standard output.
70 You can redirect the standard output to a file (which prevents
71 \fB@TABS@\fR from actually changing the tabstops),
72 and later \fBcat\fP the file to the screen, setting tabstops at that point.
73 .PP
74 These are hardware tabs, which cannot be queried rapidly by applications
75 running in the terminal, if at all.
76 Curses and other full-screen applications may use hardware tabs
77 in optimizing their output to the terminal.
78 If the hardware tabstops differ from the information in the terminal
79 database, the result is unpredictable.
80 Before running curses programs,
81 you should either reset tab-stops to the standard interval
82 .NS
83 tabs -8
84 .NE
85 .PP
86 or use the \fB@RESET@\fP program,
87 since the normal initialization sequences do not ensure that tab-stops
88 are reset.
89 .SH OPTIONS
90 .SS General Options
91 .TP 5
92 .BI \-T "name"
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
95 environment variable.
96 If that is not set, it will use the \fIansi+tabs\fP entry.
97 .TP 5
98 .B \-d
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.
102 .TP 5
103 .B \-n
104 This option tells \fB@TABS@\fP to check the options and run any debugging
105 option, but not to modify the terminal settings.
106 .TP
107 \fB\-V\fR
108 reports the version of ncurses which was used in this program, and exits.
109 .PP
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.
113 .SS Implicit Lists
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.
118 .PP
119 Use \*(``\fB\-0\fP\*('' to clear all tabs.
120 .PP
121 Use \*(``\fB\-8\fP\*('' to set tabs to the standard interval.
122 .SS Explicit Lists
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,
128 .NS
129 tabs 1,6,11,16,21
130 .br
131 tabs 1 6 11 16 21
132 .NE
133 .PP
134 Use a \*(``+\*('' to treat a number
135 as an increment relative to the previous value,
136 e.g.,
137 .NS
138 tabs 1,+5,+5,+5,+5
139 .NE
140 .PP
141 which is equivalent to the 1,6,11,16,21 example.
142 .SS Predefined Tab-Stops
143 X/Open defines several predefined lists of tab stops.
144 .TP 5
145 .B \-a
146 Assembler, IBM S/370, first format
147 .TP 5
148 .B \-a2
149 Assembler, IBM S/370, second format
150 .TP 5
151 .B \-c
152 COBOL, normal format
153 .TP 5
154 .B \-c2
155 COBOL compact format
156 .TP 5
157 .B \-c3
158 COBOL compact format extended
159 .TP 5
160 .B \-f
161 FORTRAN
162 .TP 5
163 .B \-p
164 PL/I
165 .TP 5
166 .B \-s
167 SNOBOL
168 .TP 5
169 .B \-u
170 UNIVAC 1100 Assembler
171 .SH PORTABILITY
172 .PP
173 \fIIEEE Std 1003.1/The Open Group Base Specifications Issue 7\fP (POSIX.1-2008)
174 describes a \fBtabs\fP utility.
175 However
176 .bP
177 This standard describes a \fB+m\fP option, to set a terminal's left-margin.
178 Very few of the entries in the terminal database provide the
179 \fBsmgl\fP (\fBset_left_margin\fP) or
180 \fBsmglp\fP (\fBset_left_margin_parm\fP)
181 capability needed to support the feature.
182 .bP
183 There is no counterpart in X/Open Curses Issue 7 for this utility,
184 unlike \fB@TPUT@(1)\fP.
185 .PP
186 The \fB\-d\fP (debug) and \fB\-n\fP (no-op) options are extensions not provided
187 by other implementations.
188 .PP
189 A \fBtabs\fP utility appeared in PWB/Unix 1.0 (1977).
190 There was a reduced version of the \fBtabs\fP utility
191 in Unix 7th edition and in 3BSD (1979).
192 The latter supported a single \*(``\-n\*('' option
193 (to cause the first tab stop to be set on the left margin).
194 That option is not documented by POSIX.
195 .PP
196 The PWB/Unix \fBtabs\fP utility, which was included in System III (1980),
197 used built-in tables rather than the terminal database,
198 to support a half-dozen terminal types.
199 It also had built-in logic to support the left-margin,
200 as well as a feature for copying the tab settings from a file.
201 .PP
202 Later versions of Unix, e.g., SVr4,
203 added support for the terminal database,
204 but kept the tables, as a fallback.
205 In an earlier development effort,
206 the tab-stop initialization provided by \fBtset\fP (1982)
207 and incorporated into \fBtput\fP uses the terminal database,
208 .PP
209 POSIX documents no limits on the number of tab stops.
210 Documentation for other implementations states that there is a limit on the
211 number of tab stops
212 (e.g., 20 in PWB/Unix's \fBtabs\fP utility).
213 While some terminals may not accept an arbitrary number
214 of tab stops, this implementation will attempt to set tab stops up to the
215 right margin of the screen, if the given list happens to be that long.
216 .PP
217 The \fIRationale\fP section of the POSIX documentation goes into some
218 detail about the ways the committee considered redesigning the
219 \fBtabs\fP and \fBtput\fP utilities,
220 without proposing an improved solution.
221 It comments that
222 .RS 5
223 .PP
224 no known historical version of tabs supports the capability of setting
225 arbitrary tab stops.
226 .RE
227 .PP
228 However, the \fIExplicit Lists\fP described in this manual page
229 were implemented in PWB/Unix.
230 Those provide the capability of setting abitrary tab stops.
231 .SH SEE ALSO
232 \fB@TSET@\fR(1),
233 \fB@INFOCMP@\fR(1M),
234 \fBcurses\fR(3X),
235 \fBterminfo\fR(\*n).
236 .PP
237 This describes \fBncurses\fR
238 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).