1tack(1) General Commands Manual tack(1)
2
3
4
6 tack - terminfo action checker
7
9 tack [-itV] [term]
10
12 The tack program has three purposes: (1) to help you build a new ter‐
13 minfo entry describing an unknown terminal, (2) to test the correctness
14 of an existing entry, and (3) to develop the correct pad timings needed
15 to ensure that screen updates do not fall behind the incoming data
16 stream.
17
18 Tack presents a series of screen-painting and interactive tests in ways
19 which are intended to make any mismatches between the terminfo entry
20 and reality visually obvious. Tack also provides tools that can help
21 in understanding how the terminal operates.
22
23 OPTIONS
24 -i Usually tack will send the reset and init strings to the termi‐
25 nal when the program starts up. The -i option will inhibit the
26 terminal initialization.
27
28 -t Tell tack to override the terminfo settings for basic terminal
29 functions. When this option is set tack will translate (cr) to
30 \r, (cud1) to \n, (ind) to \n, (nel) to \r\n, (cub1) to \b,
31 (bel) to \007, (ff) to \f and (ht) to \t.
32
33 -V Display the version information and exit.
34
35 term Terminfo terminal name to be tested. If not present then the
36 $TERM environment variable will be used.
37
39 Since tack is designed to test terminfo entries it is not possible to
40 rely on the correctness of the terminfo data base. Because of this the
41 menuing system used with tack is vary primitive. When a menu is
42 printed it will scroll the entire screen. To compensate for this ver‐
43 bose menu system tack permits menu selection type ahead. If you
44 already know what action you would like tack to perform then you can
45 enter that value immediately and avoid the menu display. When in doubt
46 the question mark (?) is a good character to type. A carriage return
47 will execute the default action. These default actions are designed to
48 run all the standard tests.
49
50 When tack first comes up it will display some basic information about
51 the terminal. Take some time to verify this information. If it is
52 wrong many of the subsequent tests will fail. The most important item
53 is the screen size. If the screen size is wrong there is no point in
54 proceeding. (home) and (clear) are also critical to the success of
55 subsequent tests. The values of (cr) (ind) (cub1) and (ht) may effect
56 the tests if they are defined incorrectly. If they are undefined tack
57 will set them to reasonable defaults. The last two entries on the dis‐
58 play are the enquire and acknowledge strings. These strings are taken
59 from the user strings (u9) and (u8).
60
61 By now you must be wondering why the terminfo names are enclosed in
62 parenthesis. This has no profound meaning other than it makes them
63 stand out. The tack program uses this convention any time it displays
64 a terminfo name. Remember tack is designed to rely on as little of the
65 terminfo entry as possible.
66
68 Tack has a number of tools that are designed to help gather information
69 about the terminal. Although these functions are not dependent on ter‐
70 minal type, you may wish to execute tack with options -it. This will
71 turn off initialization and default the standard entries.
72
73 These tools may be reached from the main menu by selecting the “tools”
74 entry.
75
76 Echo tool: All data typed from the keyboard will be echoed back to the
77 terminal. Control characters are not translated to the up arrow format
78 but are sent as control characters. This allows you to test an escape
79 sequence and see what it actually does. You may also elect to enable
80 hex output on echo tool this will echo the characters in hexadecimal.
81 Once the test is running you may enter the “lines” or “columns” key‐
82 words which will display a pattern that will help you determine your
83 screen size. A complete list of keywords will be displayed when the
84 test starts. Type “help” to redisplay the list of available commands.
85
86 Reply tool: This tool acts much like the echo tool, but control char‐
87 acters that are sent from the terminal more than one character after a
88 carriage return will be expanded to the up arrow format. For example
89 on a standard ANSI terminal you may type:
90
91 CR ESC [ c
92
93 and the response will be echoed as something like:
94
95 ^[ [ ? 6 c
96
97 ANSI sgr display: This test assumes you have an ANSI terminal. It
98 goes through attribute numbers 0 to 79, displaying each in turn and
99 using that SGR number to write the text. This shows you which of the
100 SGR modes are actually implemented by the terminal. Note: some termi‐
101 nals (such as Tektronix color) use the private use characters to aug‐
102 ment the functionality of the SGR command. These private use charac‐
103 ters may be interjected into the escape sequence by typing the charac‐
104 ter ( <, =, >, ? ) after the original display has been shown.
105
106 ANSI status reports: This test queries the terminal in standard
107 ANSI/VT-100 fashion. The results of this test may help determine what
108 options are supported by your terminal.
109
110 ANSI character sets: This test displays the character sets available
111 on a ANSI/VT-100 style terminal. Character sets on a real VT-100 ter‐
112 minal are usually defined with smacs=\E(0 and rmacs=\E(B. The first
113 character after the escape defines the font bank. The second character
114 defines the character set. This test allows you to view any of the
115 possible combinations. Private use character sets are defined by the
116 digits. Standard character sets are located in the alphabetic range.
117
119 You can verify the correctness of an entry with the “begin testing”
120 function. This entry is the default action and will be chosen if you
121 hit carriage return (or enter). This will bring up a secondary menu
122 that allows you to select more specific tests.
123
124 The general philosophy of the program is, for each capability, to send
125 an appropriate test pattern to the terminal then send a description of
126 what the user should expect. Occasionally (as when checking function-
127 key capabilities) the program will ask you to enter input for it to
128 check.
129
130 If the test fails then you have the option of dynamically changing the
131 terminfo entry and re-running the test. This is done with the “edit
132 terminfo” menu item. The edit submenu allows you to change the offend‐
133 ing terminfo entry and immediately retest the capability. The edit
134 menu lets you do other things with the terminfo, such as; display the
135 entire terminfo entry, display which caps have been tested and display
136 which caps cannot be tested. This menu also allows you to write the
137 newly modified terminfo to disc. If you have made any modifications to
138 the terminfo tack will ask you if you want to save the file to disc
139 before it exits. The filename will be the same as the terminal name.
140 After the program exits you can run the tic(1M) compiler on the new
141 terminfo to install it in the terminfo data base.
142
144 Theory of Overruns and Padding
145 Some terminals require significant amounts of time (that is, more than
146 one transmitted-character interval) to do screen updates that change
147 large portions of the screen, such as screen clears, line insertions,
148 line deletions, and scrolls (including scrolls triggered by line feeds
149 or a write to the lowest, right-hand-most cell of the screen).
150
151 If the computer continues to send characters to the terminal while one
152 of these time-consuming operations is going on, the screen may be gar‐
153 bled. Since the length of a character transmission time varies
154 inversely with transmission speed in cps, entries which function at
155 lower speeds may break at higher speeds.
156
157 Similar problems result if the host machine is simply sending charac‐
158 ters at a sustained rate faster than the terminal can buffer and
159 process them. In either case, when the terminal cannot process them
160 and cannot tell the host to stop soon enough, it will just drop them.
161 The dropped characters could be text, escape sequences or the escape
162 character itself, causing some really strange-looking displays. This
163 kind of glitch is called an overrun.
164
165 In terminfo entries, you can attach a pad time to each string capabil‐
166 ity that is a number of milliseconds to delay after sending it. This
167 will give the terminal time to catch up and avoid overruns.
168
169 If you are running a software terminal emulator, or you are on an X
170 pseudo-tty, or your terminal is on an RS-232C line which correctly han‐
171 dles RTS/CTS hardware flow control, then pads are not strictly neces‐
172 sary. However, some display packages (such as ncurses(3X)) use the pad
173 counts to calculate the fastest way to implement certain functions.
174 For example: scrolling the screen may be faster than deleting the top
175 line.
176
177 One common way to avoid overruns is with XON/XOFF handshaking. But
178 even this handshake may have problems at high baud rates. This is a
179 result of the way XON/XOFF works. The terminal tells the host to stop
180 with an XOFF. When the host gets this character, it stops sending.
181 However, there is a small amount of time between the stop request and
182 the actual stop. During this window, the terminal must continue to
183 accept characters even though it has told the host to stop. If the
184 terminal sends the stop request too late, then its internal buffer will
185 overflow. If it sends the stop character too early, then the terminal
186 is not getting the most efficient use out of its internal buffers. In
187 a real application at high baud rates, a terminal could get a dozen or
188 more characters before the host gets around to suspending transmission.
189 Connecting the terminal over a network will make the problem much
190 worse.
191
192 (RTS/CTS handshaking does not have this problem because the UARTs are
193 signal-connected and the "stop flow" is done at the lowest level, with‐
194 out software intervention).
195
196 Timing your terminal
197 In order to get accurate timings from your terminal tack needs to know
198 when the terminal has finished processing all the characters that were
199 sent. This requires a different type of handshaking than the XON/XOFF
200 that is supported by most terminals. Tack needs to send a request to
201 the terminal and wait for its reply. Many terminals will respond with
202 an ACK when they receive an ENQ. This is the preferred method since
203 the sequence is short. ANSI/VT-100 style terminals can mimic this
204 handshake with the escape sequence that requests “primary device
205 attributes”.
206
207 ESC [ c
208
209 The terminal will respond with a sequence like:
210
211 ESC [ ? 1 ; 0 c
212
213 Tack assumes that (u9) is the enquire sequence and that (u8) is the
214 acknowledge string. A VT-100 style terminal could set u9=\E[c and
215 u8=\E[?1;0c. Acknowledge strings fall into two categories. 1) Strings
216 with a unique terminating character and, 2) strings of fixed length.
217 The acknowledge string for the VT-100 is of the first type since it
218 always ends with the letter “c”. Some Tektronics terminals have fixed
219 length acknowledge strings. Tack supports both types of strings by
220 scanning for the terminating character until the length of the expected
221 acknowledge string has arrived. (u8) should be set to some typical
222 acknowledge that will be returned when (u9) is sent.
223
224 Tack will test this sequence before running any of the pad tests or the
225 function key tests. Tack will ask you the following:
226
227 Hit lower case g to start testing...
228
229 After it sends this message it will send the enquire string. It will
230 then read characters from the terminal until it sees the letter g.
231
232 Testing and Repairing Pad Timings
233 The pad timings in distributed terminfo entries are often incorrect.
234 One major motivation for this program is to make it relatively easy to
235 tune these timings.
236
237 You can verify and edit the pad timings for a terminal with the “test
238 string capabilities” function (this is also part of the “normal test
239 sequence” function).
240
241 The key to determining pad times is to find out the effective baud rate
242 of the terminal. The effective baud rate determines the number of
243 characters per second that the terminal can accept without either hand‐
244 shaking or losing data. This rate is frequently less than the nominal
245 cps rate on the RS-232 line.
246
247 Tack uses the effective baud rate to judge the duration of the test and
248 how much a particular escape sequence will perturb the terminal.
249
250 Each pad test has two associated variables that can be tweaked to help
251 verify the correctness of the pad timings. One is the pad test length.
252 The other is the pad multiplier, which is used if the pad prefix
253 includes “*”. In curses use, it is often the first parameter of the
254 capability (if there is one). For a capability like (dch) or (il) this
255 will be the number of character positions or lines affected, respec‐
256 tively.
257
258 Tack will run the pad tests and display the results to the terminal.
259 On capabilities that have multipliers tack will not tell you if the pad
260 needs the multiplier or not. You must make this decision yourself by
261 rerunning the test with a different multiplier. If the padding changes
262 in proportion to the multiplier than the multiplier is required. If
263 the multiplier has little or no effect on the suggested padding then
264 the multiplier is not needed. Some capabilities will take several runs
265 to get a good feel for the correct values. You may wish to make the
266 test longer to get more accurate results. System load will also effect
267 the results (a heavily loaded system will not stress the terminal as
268 much, possibly leading to pad timings that are too short).
269
271 The tests done at the beginning of the program are assumed to be cor‐
272 rect later in the code. In particular, tack displays the number of
273 lines and columns indicated in the terminfo entry as part of its ini‐
274 tial output. If these values are wrong a large number of tests will
275 fail or give incorrect results.
276
278 tack.log If logging is enabled then all characters written to the
279 terminal will also be written to the log file. This gives
280 you the ability to see how the tests were performed. This
281 feature is disabled by default.
282
283 term If you make changes to the terminfo entry tack will save
284 the new terminfo to a file. The file will have the same
285 name as the terminal name.
286
288 terminfo(5), ncurses(3X), tic(1M), infocmp(1M). You should also have
289 the documentation supplied by the terminal manufacturer.
290
292 If the screen size is incorrect, many of the tests will fail.
293
295 Concept, design, and original implementation by Daniel Weaver
296 <dan.weaver@znyx.com>. Portions of the code and documentation are by
297 Eric S. Raymond <esr@snark.thyrsus.com>.
298
299
300
301 tack(1)