1term::ansi::send(n)            Terminal control            term::ansi::send(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       term::ansi::send - Output of ANSI control sequences to terminals
9

SYNOPSIS

11       package require Tcl  8.4
12
13       package require term::ansi::send  ?0.2?
14
15       ::term::ansi::send::import ?ns? ...
16
17       ::term::ansi::send::eeol
18
19       ::term::ansi::send::esol
20
21       ::term::ansi::send::el
22
23       ::term::ansi::send::ed
24
25       ::term::ansi::send::eu
26
27       ::term::ansi::send::es
28
29       ::term::ansi::send::sd
30
31       ::term::ansi::send::su
32
33       ::term::ansi::send::ch
34
35       ::term::ansi::send::sc
36
37       ::term::ansi::send::rc
38
39       ::term::ansi::send::sca
40
41       ::term::ansi::send::rca
42
43       ::term::ansi::send::st
44
45       ::term::ansi::send::ct
46
47       ::term::ansi::send::cat
48
49       ::term::ansi::send::qdc
50
51       ::term::ansi::send::qds
52
53       ::term::ansi::send::qcp
54
55       ::term::ansi::send::rd
56
57       ::term::ansi::send::elw
58
59       ::term::ansi::send::dlw
60
61       ::term::ansi::send::eg
62
63       ::term::ansi::send::lg
64
65       ::term::ansi::send::scs0 tag
66
67       ::term::ansi::send::scs1 tag
68
69       ::term::ansi::send::sda arg...
70
71       ::term::ansi::send::sda_fgblack
72
73       ::term::ansi::send::sda_fgred
74
75       ::term::ansi::send::sda_fggreen
76
77       ::term::ansi::send::sda_fgyellow
78
79       ::term::ansi::send::sda_fgblue
80
81       ::term::ansi::send::sda_fgmagenta
82
83       ::term::ansi::send::sda_fgcyan
84
85       ::term::ansi::send::sda_fgwhite
86
87       ::term::ansi::send::sda_fgdefault
88
89       ::term::ansi::send::sda_bgblack
90
91       ::term::ansi::send::sda_bgred
92
93       ::term::ansi::send::sda_bggreen
94
95       ::term::ansi::send::sda_bgyellow
96
97       ::term::ansi::send::sda_bgblue
98
99       ::term::ansi::send::sda_bgmagenta
100
101       ::term::ansi::send::sda_bgcyan
102
103       ::term::ansi::send::sda_bgwhite
104
105       ::term::ansi::send::sda_bgdefault
106
107       ::term::ansi::send::sda_bold
108
109       ::term::ansi::send::sda_dim
110
111       ::term::ansi::send::sda_italic
112
113       ::term::ansi::send::sda_underline
114
115       ::term::ansi::send::sda_blink
116
117       ::term::ansi::send::sda_revers
118
119       ::term::ansi::send::sda_hidden
120
121       ::term::ansi::send::sda_strike
122
123       ::term::ansi::send::sda_nobold
124
125       ::term::ansi::send::sda_noitalic
126
127       ::term::ansi::send::sda_nounderline
128
129       ::term::ansi::send::sda_noblink
130
131       ::term::ansi::send::sda_norevers
132
133       ::term::ansi::send::sda_nohidden
134
135       ::term::ansi::send::sda_nostrike
136
137       ::term::ansi::send::sda_reset
138
139       ::term::ansi::send::fcp row col
140
141       ::term::ansi::send::cu ?n?
142
143       ::term::ansi::send::cd ?n?
144
145       ::term::ansi::send::cf ?n?
146
147       ::term::ansi::send::cb ?n?
148
149       ::term::ansi::send::ss ?s e?
150
151       ::term::ansi::send::skd code str
152
153       ::term::ansi::send::title str
154
155       ::term::ansi::send::gron
156
157       ::term::ansi::send::groff
158
159       ::term::ansi::send::tlc
160
161       ::term::ansi::send::trc
162
163       ::term::ansi::send::brc
164
165       ::term::ansi::send::blc
166
167       ::term::ansi::send::ltj
168
169       ::term::ansi::send::ttj
170
171       ::term::ansi::send::rtj
172
173       ::term::ansi::send::btj
174
175       ::term::ansi::send::fwj
176
177       ::term::ansi::send::hl
178
179       ::term::ansi::send::vl
180
181       ::term::ansi::send::groptim str
182
183       ::term::ansi::send::clear
184
185       ::term::ansi::send::init
186
187       ::term::ansi::send::showat row col text
188
189______________________________________________________________________________
190

DESCRIPTION

192       This  package provides commands to send ANSI terminal control sequences
193       to a terminal. All commands come in two variants, one  for  sending  to
194       any channel, the other for sending to stdout.
195
196       The  commands  are  defined using the control sequences provided by the
197       package term::ansi::code::ctrl. They have the  same  arguments  as  the
198       commands they are based on, with the exception of the variant for send‐
199       ing to any channel.  Their first argument is always a  channel  handle,
200       then  followed  by  the original arguments. Below we will list only the
201       variant sending to stdout.
202
203       ::term::ansi::send::import ?ns? ...
204              Imports the commands of this package into the namespace  ns.  If
205              not  specified  it defaults to send. Note that this default is a
206              relative namespace name, i.e. the actual namespace will be  cre‐
207              ated under the current namespace.
208
209              By  default  all  commands will be imported, this can however be
210              restricted to specific commands, by listing them after the name‐
211              space to import them into.
212
213       ::term::ansi::send::eeol
214              Erase (to) End Of Line.
215
216       ::term::ansi::send::esol
217              Erase (to) Start Of Line.
218
219       ::term::ansi::send::el
220              Erase (current) Line.
221
222       ::term::ansi::send::ed
223              Erase Down (to bottom).
224
225       ::term::ansi::send::eu
226              Erase Up (to top).
227
228       ::term::ansi::send::es
229              Erase Screen.
230
231       ::term::ansi::send::sd
232              Scroll Down.
233
234       ::term::ansi::send::su
235              Scroll Up.
236
237       ::term::ansi::send::ch
238              Cursor Home.
239
240       ::term::ansi::send::sc
241              Save Cursor. Note: Only one saved position can be handled.  This
242              is no unlimited stack. Saving before  restoring  will  overwrite
243              the saved data.
244
245       ::term::ansi::send::rc
246              Restore Cursor (Unsave).
247
248       ::term::ansi::send::sca
249              Save Cursor + Attributes.
250
251       ::term::ansi::send::rca
252              Restore Cursor + Attributes.
253
254       ::term::ansi::send::st
255              Set Tab (@ current position).
256
257       ::term::ansi::send::ct
258              Clear Tab (@ current position).
259
260       ::term::ansi::send::cat
261              Clear All Tabs.
262
263       ::term::ansi::send::qdc
264              Query Device Code.
265
266       ::term::ansi::send::qds
267              Query Device Status.
268
269       ::term::ansi::send::qcp
270              Query Cursor Position.
271
272       ::term::ansi::send::rd
273              Reset Device.
274
275       ::term::ansi::send::elw
276              Enable Line Wrap.
277
278       ::term::ansi::send::dlw
279              Disable Line Wrap.
280
281       ::term::ansi::send::eg
282              Enter Graphics Mode.
283
284       ::term::ansi::send::lg
285              Exit Graphics Mode.
286
287       ::term::ansi::send::scs0 tag
288
289       ::term::ansi::send::scs1 tag
290              Select Character Set.
291
292              Choose which character set is used for default (scs0) and alter‐
293              nate font (scs1).  This does not change whether default  or  al‐
294              ternate font are used, just their definitions.
295
296              The legal tags, and their meanings, are:
297
298              A      United Kingdom Set
299
300              B      ASCII Set
301
302              0      Special Graphics
303
304              1      Alternate Character ROM Standard Character Set
305
306              2      Alternate Character ROM Special Graphics
307
308       ::term::ansi::send::sda arg...
309              Set Display Attributes. The arguments are the code sequences for
310              the  possible   attributes,   as   provided   by   the   package
311              term::ansi::code::attr.  For  convenience this package also pro‐
312              vides additional commands each setting a single specific  attri‐
313              bute.
314
315       ::term::ansi::send::sda_fgblack
316              Set text color to Black.
317
318       ::term::ansi::send::sda_fgred
319              Set text color to Red.
320
321       ::term::ansi::send::sda_fggreen
322              Set text color to Green.
323
324       ::term::ansi::send::sda_fgyellow
325              Set text color to Yellow.
326
327       ::term::ansi::send::sda_fgblue
328              Set text color to Blue.
329
330       ::term::ansi::send::sda_fgmagenta
331              Set text color to Magenta.
332
333       ::term::ansi::send::sda_fgcyan
334              Set text color to Cyan.
335
336       ::term::ansi::send::sda_fgwhite
337              Set text color to White.
338
339       ::term::ansi::send::sda_fgdefault
340              Set default text color (Black).
341
342       ::term::ansi::send::sda_bgblack
343              Set background to Black.
344
345       ::term::ansi::send::sda_bgred
346              Set background to Red.
347
348       ::term::ansi::send::sda_bggreen
349              Set background to Green.
350
351       ::term::ansi::send::sda_bgyellow
352              Set background to Yellow.
353
354       ::term::ansi::send::sda_bgblue
355              Set background to Blue.
356
357       ::term::ansi::send::sda_bgmagenta
358              Set background to Magenta.
359
360       ::term::ansi::send::sda_bgcyan
361              Set background to Cyan.
362
363       ::term::ansi::send::sda_bgwhite
364              Set background to White.
365
366       ::term::ansi::send::sda_bgdefault
367              Set default background (Transparent).
368
369       ::term::ansi::send::sda_bold
370              Bold on.
371
372       ::term::ansi::send::sda_dim
373              Dim on.
374
375       ::term::ansi::send::sda_italic
376              Italics on.
377
378       ::term::ansi::send::sda_underline
379              Underscore on.
380
381       ::term::ansi::send::sda_blink
382              Blink on.
383
384       ::term::ansi::send::sda_revers
385              Reverse on.
386
387       ::term::ansi::send::sda_hidden
388              Hidden on.
389
390       ::term::ansi::send::sda_strike
391              Strike-through on.
392
393       ::term::ansi::send::sda_nobold
394              Bold off.
395
396       ::term::ansi::send::sda_noitalic
397              Italics off.
398
399       ::term::ansi::send::sda_nounderline
400              Underscore off.
401
402       ::term::ansi::send::sda_noblink
403              Blink off.
404
405       ::term::ansi::send::sda_norevers
406              Reverse off.
407
408       ::term::ansi::send::sda_nohidden
409              Hidden off.
410
411       ::term::ansi::send::sda_nostrike
412              Strike-through off.
413
414       ::term::ansi::send::sda_reset
415              Reset all attributes to their default values.
416
417       ::term::ansi::send::fcp row col
418              Force Cursor Position (aka Go To).
419
420       ::term::ansi::send::cu ?n?
421              Cursor Up. n defaults to 1.
422
423       ::term::ansi::send::cd ?n?
424              Cursor Down. n defaults to 1.
425
426       ::term::ansi::send::cf ?n?
427              Cursor Forward. n defaults to 1.
428
429       ::term::ansi::send::cb ?n?
430              Cursor Backward. n defaults to 1.
431
432       ::term::ansi::send::ss ?s e?
433              Scroll Screen (entire display, or between rows start end, inclu‐
434              sive).
435
436       ::term::ansi::send::skd code str
437              Set Key Definition.
438
439       ::term::ansi::send::title str
440              Set the terminal title.
441
442       ::term::ansi::send::gron
443              Switch to character/box graphics. I.e. switch to  the  alternate
444              font.
445
446       ::term::ansi::send::groff
447              Switch to regular characters. I.e. switch to the default font.
448
449       ::term::ansi::send::tlc
450              Character graphics, Top Left Corner.
451
452       ::term::ansi::send::trc
453              Character graphics, Top Right Corner.
454
455       ::term::ansi::send::brc
456              Character graphics, Bottom Right Corner.
457
458       ::term::ansi::send::blc
459              Character graphics, Bottom Left Corner.
460
461       ::term::ansi::send::ltj
462              Character graphics, Left T Junction.
463
464       ::term::ansi::send::ttj
465              Character graphics, Top T Junction.
466
467       ::term::ansi::send::rtj
468              Character graphics, Right T Junction.
469
470       ::term::ansi::send::btj
471              Character graphics, Bottom T Junction.
472
473       ::term::ansi::send::fwj
474              Character graphics, Four-Way Junction.
475
476       ::term::ansi::send::hl
477              Character graphics, Horizontal Line.
478
479       ::term::ansi::send::vl
480              Character graphics, Vertical Line.
481
482       ::term::ansi::send::groptim str
483              Optimize character graphics. The generator commands above create
484              way to many superfluous commands shifting into and  out  of  the
485              graphics  mode.  This  command  removes all shifts which are not
486              needed. To this end it also knows which characters will look the
487              same  in  both  modes, to handle strings created outside of this
488              package.
489
490       ::term::ansi::send::clear
491              Clear screen. In essence a sequence of CursorHome + EraseDown.
492
493       ::term::ansi::send::init
494              Initialize default and alternate fonts to ASCII and  box  graph‐
495              ics.
496
497       ::term::ansi::send::showat row col text
498              Show the block of text at the specified location.
499

BUGS, IDEAS, FEEDBACK

501       This  document,  and the package it describes, will undoubtedly contain
502       bugs and other problems.  Please report such in the  category  term  of
503       the  Tcllib  Trackers  [http://core.tcl.tk/tcllib/reportlist].   Please
504       also report any ideas for enhancements you may have for either  package
505       and/or documentation.
506
507       When proposing code changes, please provide unified diffs, i.e the out‐
508       put of diff -u.
509
510       Note further that  attachments  are  strongly  preferred  over  inlined
511       patches.  Attachments  can  be  made  by  going to the Edit form of the
512       ticket immediately after its creation, and  then  using  the  left-most
513       button in the secondary navigation bar.
514

KEYWORDS

516       character output, control, terminal
517

CATEGORY

519       Terminal control
520
522       Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
523
524
525
526
527tcllib                                0.2                  term::ansi::send(n)
Impressum