]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tabs.1
ncurses 6.1 - patch 20191130
[ncurses.git] / man / tabs.1
1 .\"***************************************************************************
2 .\" Copyright (c) 2008-2018,2019 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: tabs.1,v 1.26 2019/06/23 21:01:12 tom Exp $
30 .TH @TABS@ 1 ""
31 .ds n 5
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .de bP
37 .ie n  .IP \(bu 4
38 .el    .IP \(bu 2
39 ..
40 .de NS
41 .ie n  .sp
42 .el    .sp .5
43 .ie n  .in +4
44 .el    .in +2
45 .nf
46 .ft C                   \" Courier
47 ..
48 .de NE
49 .fi
50 .ft R
51 .ie n  .in -4
52 .el    .in -2
53 ..
54 .SH NAME
55 \fB@TABS@\fR \- set tabs on a terminal
56 .SH SYNOPSIS
57 \fB@TABS@\fR [\fIoptions\fR]] \fI[tabstop-list]\fR
58 .SH DESCRIPTION
59 .PP
60 The \fB@TABS@\fP program clears and sets tab-stops on the terminal.
61 This uses the terminfo \fIclear_all_tabs\fP and \fIset_tab\fP capabilities.
62 If either is absent, \fB@TABS@\fP is unable to clear/set tab-stops.
63 The terminal should be configured to use hard tabs, e.g.,
64 .NS
65 stty tab0
66 .NE
67 .PP
68 Like \fB@CLEAR@\fR(1), \fB@TABS@\fR writes to the standard output.
69 You can redirect the standard output to a file (which prevents
70 \fB@TABS@\fR from actually changing the tabstops),
71 and later \fBcat\fP the file to the screen, setting tabstops at that point.
72 .PP
73 These are hardware tabs, which cannot be queried rapidly by applications
74 running in the terminal, if at all.
75 Curses and other full-screen applications may use hardware tabs
76 in optimizing their output to the terminal.
77 If the hardware tabstops differ from the information in the terminal
78 database, the result is unpredictable.
79 Before running curses programs,
80 you should either reset tab-stops to the standard interval
81 .NS
82 tabs -8
83 .NE
84 .PP
85 or use the \fB@RESET@\fP program,
86 since the normal initialization sequences do not ensure that tab-stops
87 are reset.
88 .SH OPTIONS
89 .SS General Options
90 .TP 5
91 .BI \-T "name"
92 Tell \fB@TABS@\fP which terminal type to use.
93 If this option is not given, \fB@TABS@\fP will use the \fB$TERM\fP
94 environment variable.
95 If that is not set, it will use the \fIansi+tabs\fP entry.
96 .TP 5
97 .B \-d
98 The debugging option shows a ruler line, followed by two data lines.
99 The first data line shows the expected tab-stops marked with asterisks.
100 The second data line shows the actual tab-stops, marked with asterisks.
101 .TP 5
102 .B \-n
103 This option tells \fB@TABS@\fP to check the options and run any debugging
104 option, but not to modify the terminal settings.
105 .TP
106 \fB\-V\fR
107 reports the version of ncurses which was used in this program, and exits.
108 .PP
109 The \fB@TABS@\fP program processes a single list of tab stops.
110 The last option to be processed which defines a list is the one that
111 determines the list to be processed.
112 .SS Implicit Lists
113 Use a single number as an option,
114 e.g., \*(``\fB\-5\fP\*('' to set tabs at the given
115 interval (in this case 1, 6, 11, 16, 21, etc.).
116 Tabs are repeated up to the right margin of the screen.
117 .PP
118 Use \*(``\fB\-0\fP\*('' to clear all tabs.
119 .PP
120 Use \*(``\fB\-8\fP\*('' to set tabs to the standard interval.
121 .SS Explicit Lists
122 An explicit list can be defined after the options
123 (this does not use a \*(``\-\*('').
124 The values in the list must be in increasing numeric order,
125 and greater than zero.
126 They are separated by a comma or a blank, for example,
127 .NS
128 tabs 1,6,11,16,21
129 .br
130 tabs 1 6 11 16 21
131 .NE
132 .PP
133 Use a \*(``+\*('' to treat a number
134 as an increment relative to the previous value,
135 e.g.,
136 .NS
137 tabs 1,+5,+5,+5,+5
138 .NE
139 .PP
140 which is equivalent to the 1,6,11,16,21 example.
141 .SS Predefined Tab-Stops
142 X/Open defines several predefined lists of tab stops.
143 .TP 5
144 .B \-a
145 Assembler, IBM S/370, first format
146 .TP 5
147 .B \-a2
148 Assembler, IBM S/370, second format
149 .TP 5
150 .B \-c
151 COBOL, normal format
152 .TP 5
153 .B \-c2
154 COBOL compact format
155 .TP 5
156 .B \-c3
157 COBOL compact format extended
158 .TP 5
159 .B \-f
160 FORTRAN
161 .TP 5
162 .B \-p
163 PL/I
164 .TP 5
165 .B \-s
166 SNOBOL
167 .TP 5
168 .B \-u
169 UNIVAC 1100 Assembler
170 .SH PORTABILITY
171 .PP
172 \fIIEEE Std 1003.1/The Open Group Base Specifications Issue 7\fP (POSIX.1-2008)
173 describes a \fBtabs\fP utility.
174 However
175 .bP
176 This standard describes a \fB+m\fP option, to set a terminal's left-margin.
177 Very few of the entries in the terminal database provide the
178 \fBsmgl\fP (\fBset_left_margin\fP) or
179 \fBsmglp\fP (\fBset_left_margin_parm\fP)
180 capability needed to support the feature.
181 .bP
182 There is no counterpart in X/Open Curses Issue 7 for this utility,
183 unlike \fB@TPUT@(1)\fP.
184 .PP
185 The \fB\-d\fP (debug) and \fB\-n\fP (no-op) options are extensions not provided
186 by other implementations.
187 .PP
188 A \fBtabs\fP utility appeared in PWB/Unix 1.0 (1977).
189 There was a reduced version of the \fBtabs\fP utility
190 in Unix 7th edition and in 3BSD (1979).
191 The latter supported a single \*(``\-n\*('' option
192 (to cause the first tab stop to be set on the left margin).
193 That option is not documented by POSIX.
194 .PP
195 The PWB/Unix \fBtabs\fP utility, which was included in System III (1980),
196 used built-in tables rather than the terminal database,
197 to support a half-dozen terminal types.
198 It also had built-in logic to support the left-margin,
199 as well as a feature for copying the tab settings from a file.
200 .PP
201 Later versions of Unix, e.g., SVr4,
202 added support for the terminal database,
203 but kept the tables, as a fallback.
204 In an earlier development effort,
205 the tab-stop initialization provided by \fBtset\fP (1982)
206 and incorporated into \fBtput\fP uses the terminal database,
207 .PP
208 POSIX documents no limits on the number of tab stops.
209 Documentation for other implementations states that there is a limit on the
210 number of tab stops
211 (e.g., 20 in PWB/Unix's \fBtabs\fP utility).
212 While some terminals may not accept an arbitrary number
213 of tab stops, this implementation will attempt to set tab stops up to the
214 right margin of the screen, if the given list happens to be that long.
215 .PP
216 The \fIRationale\fP section of the POSIX documentation goes into some
217 detail about the ways the committee considered redesigning the
218 \fBtabs\fP and \fBtput\fP utilities,
219 without proposing an improved solution.
220 It comments that
221 .RS 5
222 .PP
223 no known historical version of tabs supports the capability of setting
224 arbitrary tab stops.
225 .RE
226 .PP
227 However, the \fIExplicit Lists\fP described in this manual page
228 were implemented in PWB/Unix.
229 Those provide the capability of setting abitrary tab stops.
230 .SH SEE ALSO
231 \fB@TSET@\fR(1),
232 \fB@INFOCMP@\fR(1M),
233 \fBcurses\fR(3X),
234 \fBterminfo\fR(\*n).
235 .PP
236 This describes \fBncurses\fR
237 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).