forked from pborman/ansi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansi.go
3861 lines (3690 loc) · 129 KB
/
ansi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2014 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package ansi provides ansi escape sequence processing as defined by the
// ECMA-48 standard "Control Functions for Coded Character Sets - Fifth Edition"
//
// From the standard:
//
// Free printed copies of this standard can be ordered from:
// ECMA
// 114 Rue du Rhône CH-1204 Geneva Switzerland
// Fax: +41 22 849.60.01 Email: [email protected]
// Files of this Standard can be freely downloaded from the ECMA web site
// (www.ecma.ch). This site gives full information on ECMA, ECMA activities,
// ECMA Standards and Technical Reports.
//
// Portions of the standared are included in the documentation for this package.
// The standard bears no copyright.
//
// Each escape sequence is represented by a string constant and a Sequence
// structure. For the escape sequence named SEQ, SEQ is the string constant and
// SEQ_ is the related Sequence structure. A mapping from a sequence string to
// its Sequence structure is provided in Table.
//
// Some escape sequences may contain parameters, for example "\033[4A". This
// sequence contains the parameter "4". The name of the sequences is "\033[A"
// (the parameter is missing). The sequence "\033[1;2 c" is named "\033[ c" and
// has the parameters "1", and "2".
//
// The C1 control set has both a two byte and a single byte representation. The
// two byte representation is an Escape followed by a byte in the range of 0x40
// to 0x5f. They may also be specified by a single byte in the range of 0x80 -
// 0x9f. This ansi package always names the C1 control set in the two byte
// form.
package ansi
// A Sequence specifies an ANSI (ECMA-48) Escape Sequence.
// If the default value of a parameter is -1 then that parameter must
// be specified (but following parameters may be defaulted).
type Sequence struct {
Name string // Short name of the sequence
Desc string // Description of the sequence
Notation string // Notation the sequence uses
Type Name // Prefix type: ESC, CSI or ""
NParam int // Number of parameters (-1 implies any number)
MinParam int // Minium number of parameters that must be present
Defaults []string // Default values of parameters (if any)
Code []byte // Code bytes
}
// A Name is the name of ansi escape sequence.
type Name string
// S returns a reference to the Sequence for n.
func (n Name) S() *Sequence {
return Table[n]
}
// The remainder of this file was automatically generated from the ECMA-48
// standard.
// ANSI (ECMA-48) Sequences.
// These sequences do not include parameters or string termination sequences.
const (
NUL = Name("\000") // Null
SOH = Name("\001") // Start of Heading
STX = Name("\002") // Start of Text
ETX = Name("\003") // End of Text
EOT = Name("\004") // End of Transmission
ENQ = Name("\005") // Enquiry
ACK = Name("\006") // Acknowledge
BEL = Name("\007") // Bell
BS = Name("\010") // Backspace
HT = Name("\011") // Character Tabulation
LF = Name("\012") // Line Feed
VT = Name("\013") // Line Tabulation
FF = Name("\014") // Form Feed
CR = Name("\015") // Carriage Return
SO = Name("\016") // Shift-Out
SI = Name("\017") // Shift-In
DLE = Name("\020") // Data Link Escape
DC1 = Name("\021") // Device Control One
DC2 = Name("\022") // Device Control Two
DC3 = Name("\023") // Device Control Three
DC4 = Name("\024") // Device Control Four
NAK = Name("\025") // Negative Acknowledge
SYN = Name("\026") // Synchronous Idle
ETB = Name("\027") // End of Transmission Block
CAN = Name("\030") // Cancel
EM = Name("\031") // End of Medium
SUB = Name("\032") // Substitute
ESC = Name("\033") // Escape
IS4 = Name("\034") // Information Separator Four (FS - File Separator)
IS3 = Name("\035") // Information Separator Three (GS - Group Separator)
IS2 = Name("\036") // Information Separator Two (RS - Record Separator)
IS1 = Name("\037") // Information Separator One (US - Unit Separator)
APC = Name("\033_") // Application Program Command
BPH = Name("\033B") // Break Permitted Here
CBT = Name("\033[Z") // Cursor Backward Tabulation
CCH = Name("\033T") // Cancel Character
CHA = Name("\033[G") // Cursor Character Absolute
CHT = Name("\033[I") // Cursor Forward Tabulation
CMD = Name("\033d") // Coding Method Delimiter
CNL = Name("\033[E") // Cursor Next Line
CPL = Name("\033[F") // Cursor Preceding Line
CPR = Name("\033[R") // Active Position Report
CSI = Name("\033[") // Control Sequence Introducer
CTC = Name("\033[W") // Cursor Tabulation Control
CUB = Name("\033[D") // Cursor Left
CUD = Name("\033[B") // Cursor Down
CUF = Name("\033[C") // Cursor Right
CUP = Name("\033[H") // Cursor Position
CUU = Name("\033[A") // Cursor Up
CVT = Name("\033[Y") // Cursor Line Tabulation
DA = Name("\033[c") // Device Attributes
DAQ = Name("\033[o") // Define Area Qualification
DCH = Name("\033[P") // Delete Character
DCS = Name("\033P") // Device Control String
DL = Name("\033[M") // Delete Line
DMI = Name("\033`") // Disable Manual Input
DSR = Name("\033[n") // Device Status Report
DTA = Name("\033[ T") // Dimension Text Area
EA = Name("\033[O") // Erase in Area
ECH = Name("\033[X") // Erase Character
ED = Name("\033[J") // Erase in Page
EF = Name("\033[N") // Erase in Field
EL = Name("\033[K") // Erase in Line
EMI = Name("\033b") // Enable Manual Input
EPA = Name("\033W") // End of Guarded Area
ESA = Name("\033G") // End of Selected Area
FNK = Name("\033[ W") // Function Key
FNT = Name("\033[ D") // Font Selection
GCC = Name("\033[ _") // Graphic Character Combination
GSM = Name("\033[ B") // Graphic Size Modification
GSS = Name("\033[ C") // Graphic Size Selection
HPA = Name("\033[`") // Character Position Absolute
HPB = Name("\033[j") // Character Position Backward
HPR = Name("\033[a") // Character Position Forward
HTJ = Name("\033I") // Character Tabulation With Justification
HTS = Name("\033H") // Character Tabulation Set
HVP = Name("\033[f") // Character and Line Position
ICH = Name("\033[@") // Insert Character
IDCS = Name("\033[ O") // Identify Device Control String
IGS = Name("\033[ M") // Identify Graphic Subrepertoire
IL = Name("\033[L") // Insert Line
INT = Name("\033a") // Interrupt
JFY = Name("\033[ F") // Justify
LS1R = Name("\033~") // Locking-Shift One Right
LS2 = Name("\033n") // Locking-Shift Two
LS2R = Name("\033}") // Locking-Shift Two Right
LS3 = Name("\033o") // Locking-Shift Three
LS3R = Name("\033|") // Locking-Shift Three Right
MC = Name("\033[i") // Media Copy
MW = Name("\033U") // Message Waiting
NBH = Name("\033C") // No Break Here
NEL = Name("\033E") // Next Line
NP = Name("\033[U") // Next Page
OSC = Name("\033]") // Operating System Command
PEC = Name("\033[ Z") // Presentation Expand or Contract
PFS = Name("\033[ J") // Page Format Selection
PLD = Name("\033K") // Partial Line Forward
PLU = Name("\033L") // Partial Line Backward
PM = Name("\033^") // Privacy Message
PP = Name("\033[V") // Preceding Page
PPA = Name("\033[ P") // Page Position Absolute
PPB = Name("\033[ R") // Page Position Backward
PPR = Name("\033[ Q") // Page Position Forward
PTX = Name("\033[\\") // Parallel Texts
PU1 = Name("\033Q") // Private Use One
PU2 = Name("\033R") // Private Use Two
QUAD = Name("\033[ H") // Quad
REP = Name("\033[b") // Repeat
RI = Name("\033M") // Reverse Line Feed
RIS = Name("\033c") // Reset to Initial State
RM = Name("\033[l") // Reset Mode
SACS = Name("\033[ \\") // Set Additional Character Separation
SAPV = Name("\033[ ]") // Select Alternative Presentation Variants
SCI = Name("\033Z") // Single Character Introducer
SCO = Name("\033[ e") // Select Character Orientation
SCP = Name("\033[ k") // Select Character Path
SCS = Name("\033[ g") // Set Character Spacing
SD = Name("\033[T") // Scroll Down
SDS = Name("\033[]") // Start Directed String
SEE = Name("\033[Q") // Select Editing Extent
SEF = Name("\033[ Y") // Sheet Eject and Feed
SGR = Name("\033[m") // Select Graphic Rendition
SHS = Name("\033[ K") // Select Character Spacing
SIMD = Name("\033[^") // Select Implicit Movement Direction
SL = Name("\033[ @") // Scroll Left
SLH = Name("\033[ U") // Set Line Home
SLL = Name("\033[ V") // Set Line Limit
SLS = Name("\033[ h") // Set Line Spacing
SM = Name("\033[h") // Set Mode
SOS = Name("\033X") // Start of String
SPA = Name("\033V") // Start of Guarded Area
SPD = Name("\033[ S") // Select Presentation Directions
SPH = Name("\033[ i") // Set Page Home
SPI = Name("\033[ G") // Spacing Increment
SPL = Name("\033[ j") // Set Page Limit
SPQR = Name("\033[ X") // Select Print Quality and Rapidity
SR = Name("\033[ A") // Scroll Right
SRCS = Name("\033[ f") // Set Reduced Character Separation
SRS = Name("\033[[") // Start Reversed String
SSA = Name("\033F") // Start of Selected Area
SSU = Name("\033[ I") // Select Size Unit
SSW = Name("\033[ [") // Set Space Width
SS2 = Name("\033N") // Single-Shift Two
SS3 = Name("\033O") // Single-Shift Three
ST = Name("\033\\") // String Terminator
STAB = Name("\033[ ^") // Selective Tabulation
STS = Name("\033S") // Set Transmit State
SU = Name("\033[S") // Scroll Up
SVS = Name("\033[ L") // Select Line Spacing
TAC = Name("\033[ b") // Tabulation Aligned Centred
TALE = Name("\033[ a") // Tabulation Aligned Leading Edge
TATE = Name("\033[ `") // Tabulation Aligned Trailing Edge
TBC = Name("\033[g") // Tabulation Clear
TCC = Name("\033[ c") // Tabulation Centred on Character
TSR = Name("\033[ d") // Tabulation Stop Remove
TSS = Name("\033[ E") // Thin Space Specification
VPA = Name("\033[d") // Line Position Absolute
VPB = Name("\033[k") // Line Position Backward
VPR = Name("\033[e") // Line Position Forward
VTS = Name("\033J") // Line Tabulation Set
C0 = Name("\033!@") // Control Set 0 Announcer
C1 = Name("\033&@") // Control Set 1 Announcer
C1ALT1 = Name("\033 F") // Control Set 1 Announcer Alternate 1
C1ALT2 = Name("\033\"F") // Control Set 1 Announcer Alternate 2
)
// NUL is used for media-fill or time-fill. NUL characters may be inserted
// into, or removed from, a data stream without affecting the information
// content of that stream, but such action may affect the information layout
// and/or the control of equipment.
var NUL_ = Sequence{
Name: "NUL",
Desc: "Null",
Code: []byte(NUL),
}
// SOH is used to indicate the beginning of a heading.
//
// The use of SOH is defined in ISO 1745.
var SOH_ = Sequence{
Name: "SOH",
Desc: "Start of Heading",
Code: []byte(SOH),
}
// STX is used to indicate the beginning of a text and the end of a heading.
//
// The use of STX is defined in ISO 1745.
var STX_ = Sequence{
Name: "STX",
Desc: "Start of Text",
Code: []byte(STX),
}
// ETX is used to indicate the end of a text.
//
// The use of ETX is defined in ISO 1745.
var ETX_ = Sequence{
Name: "ETX",
Desc: "End of Text",
Code: []byte(ETX),
}
// EOT is used to indicate the conclusion of the transmission of one or more
// texts.
//
// The use of EOT is defined in ISO 1745.
var EOT_ = Sequence{
Name: "EOT",
Desc: "End of Transmission",
Code: []byte(EOT),
}
// ENQ is transmitted by a sender as a request for a response from a receiver.
//
// The use of ENQ is defined in ISO 1745.
var ENQ_ = Sequence{
Name: "ENQ",
Desc: "Enquiry",
Code: []byte(ENQ),
}
// ACK is transmitted by a receiver as an affirmative response to the sender.
//
// The use of ACK is defined in ISO 1745.
var ACK_ = Sequence{
Name: "ACK",
Desc: "Acknowledge",
Code: []byte(ACK),
}
// BEL is used when there is a need to call for attention; it may control alarm
// or attention devices.
var BEL_ = Sequence{
Name: "BEL",
Desc: "Bell",
Code: []byte(BEL),
}
// BS causes the active data position to be moved one character position in the
// data component in the direction opposite to that of the implicit movement.
//
// The direction of the implicit movement depends on the parameter value of
// SELECT IMPLICIT MOVEMENT DIRECTION (SIMD).
var BS_ = Sequence{
Name: "BS",
Desc: "Backspace",
Code: []byte(BS),
}
// HT causes the active presentation position to be moved to the following
// character tabulation stop in the presentation component.
//
// In addition, if that following character tabulation stop has been set by
// TABULATION ALIGN CENTRE (TAC), TABULATION ALIGN LEADING EDGE (TALE),
// TABULATION ALIGN TRAILING EDGE (TATE) or TABULATION CENTRED ON CHARACTER
// (TCC), HT indicates the beginning of a string of text which is to be
// positioned within a line according to the properties of that tabulation
// stop. The end of the string is indicated by the next occurrence of HT or
// CARRIAGE RETURN (CR) or NEXT LINE (NEL) in the data stream.
var HT_ = Sequence{
Name: "HT",
Desc: "Character Tabulation",
Code: []byte(HT),
}
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to PRESENTATION, LF causes
// the active presentation position to be moved to the corresponding character
// position of the following line in the presentation component.
//
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to DATA, LF causes the
// active data position to be moved to the corresponding character position of
// the following line in the data component.
var LF_ = Sequence{
Name: "LF",
Desc: "Line Feed",
Code: []byte(LF),
}
// VT causes the active presentation position to be moved in the presentation
// component to the corresponding character position on the line at which the
// following line tabulation stop is set.
var VT_ = Sequence{
Name: "VT",
Desc: "Line Tabulation",
Code: []byte(VT),
}
// FF causes the active presentation position to be moved to the corresponding
// character position of the line at the page home position of the next form or
// page in the presentation component. The page home position is established by
// the parameter value of SET PAGE HOME (SPH).
var FF_ = Sequence{
Name: "FF",
Desc: "Form Feed",
Code: []byte(FF),
}
// The effect of CR depends on the setting of the DEVICE COMPONENT SELECT MODE
// (DCSM) and on the parameter value of SELECT IMPLICIT MOVEMENT DIRECTION
// (SIMD).
//
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to PRESENTATION and with
// the parameter value of SIMD equal to 0, CR causes the active presentation
// position to be moved to the line home position of the same line in the
// presentation component. The line home position is established by the
// parameter value of SET LINE HOME (SLH).
//
// With a parameter value of SIMD equal to 1, CR causes the active presentation
// position to be moved to the line limit position of the same line in the
// presentation component. The line limit position is established by the
// parameter value of SET LINE LIMIT (SLL).
//
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to DATA and with a
// parameter value of SIMD equal to 0, CR causes the active data position to be
// moved to the line home position of the same line in the data component. The
// line home position is established by the parameter value of SET LINE HOME
// (SLH).
//
// With a parameter value of SIMD equal to 1, CR causes the active data
// position to be moved to the line limit position of the same line in the data
// component. The line limit position is established by the parameter value of
// SET LINE LIMIT (SLL).
var CR_ = Sequence{
Name: "CR",
Desc: "Carriage Return",
Code: []byte(CR),
}
// SO is used for code extension purposes. It causes the meanings of the bit
// combinations following it in the data stream to be changed.
//
// The use of SO is defined in Standard ECMA-35.
//
// NOTE
//
// SO is used in 7-bit environments only; in 8-bit environments LOCKING-SHIFT
// ONE (LS1) is used instead.
var SO_ = Sequence{
Name: "SO",
Desc: "Shift-Out",
Code: []byte(SO),
}
// SI is used for code extension purposes. It causes the meanings of the bit
// combinations following it in the data stream to be changed.
//
// The use of SI is defined in Standard ECMA-35.
//
// NOTE
//
// SI is used in 7-bit environments only; in 8-bit environments LOCKING-SHIFT
// ZERO (LS0) is used instead.
var SI_ = Sequence{
Name: "SI",
Desc: "Shift-In",
Code: []byte(SI),
}
// DLE is used exclusively to provide supplementary transmission control
// functions.
//
// The use of DLE is defined in ISO 1745.
var DLE_ = Sequence{
Name: "DLE",
Desc: "Data Link Escape",
Code: []byte(DLE),
}
// DC1 is primarily intended for turning on or starting an ancillary device. If
// it is not required for this purpose, it may be used to restore a device to
// the basic mode of operation (see also DC2 and DC3), or any other device
// control function not provided by other DCs.
//
// NOTE
//
// When used for data flow control, DC1 is sometimes called "X-ON".
var DC1_ = Sequence{
Name: "DC1",
Desc: "Device Control One",
Code: []byte(DC1),
}
// DC2 is primarily intended for turning on or starting an ancillary device. If
// it is not required for this purpose, it may be used to set a device to a
// special mode of operation (in which case DC1 is used to restore the device
// to the basic mode), or for any other device control function not provided by
// other DCs.
var DC2_ = Sequence{
Name: "DC2",
Desc: "Device Control Two",
Code: []byte(DC2),
}
// DC3 is primarily intended for turning off or stopping an ancillary device.
// This function may be a secondary level stop, for example wait, pause,
// stand-by or halt (in which case DC1 is used to restore normal operation). If
// it is not required for this purpose, it may be used for any other device
// control function not provided by other DCs.
//
// NOTE
//
// When used for data flow control, DC3 is sometimes called "X-OFF".
var DC3_ = Sequence{
Name: "DC3",
Desc: "Device Control Three",
Code: []byte(DC3),
}
// DC4 is primarily intended for turning off, stopping or interrupting an
// ancillary device. If it is not required for this purpose, it may be used for
// any other device control function not provided by other DCs.
var DC4_ = Sequence{
Name: "DC4",
Desc: "Device Control Four",
Code: []byte(DC4),
}
// NAK is transmitted by a receiver as a negative response to the sender.
//
// The use of NAK is defined in ISO 1745.
var NAK_ = Sequence{
Name: "NAK",
Desc: "Negative Acknowledge",
Code: []byte(NAK),
}
// SYN is used by a synchronous transmission system in the absence of any other
// character (idle condition) to provide a signal from which synchronism may be
// achieved or retained between data terminal equipment.
//
// The use of SYN is defined in ISO 1745.
var SYN_ = Sequence{
Name: "SYN",
Desc: "Synchronous Idle",
Code: []byte(SYN),
}
// ETB is used to indicate the end of a block of data where the data are
// divided into such blocks for transmission purposes.
//
// The use of ETB is defined in ISO 1745.
var ETB_ = Sequence{
Name: "ETB",
Desc: "End of Transmission Block",
Code: []byte(ETB),
}
// CAN is used to indicate that the data preceding it in the data stream is in
// error. As a result, this data shall be ignored. The specific meaning of this
// control function shall be defined for each application and/or between sender
// and recipient.
var CAN_ = Sequence{
Name: "CAN",
Desc: "Cancel",
Code: []byte(CAN),
}
// EM is used to identify the physical end of a medium, or the end of the used
// portion of a medium, or the end of the wanted portion of data recorded on a
// medium.
var EM_ = Sequence{
Name: "EM",
Desc: "End of Medium",
Code: []byte(EM),
}
// SUB is used in the place of a character that has been found to be invalid or
// in error. SUB is intended to be introduced by automatic means.
var SUB_ = Sequence{
Name: "SUB",
Desc: "Substitute",
Code: []byte(SUB),
}
// ESC is used for code extension purposes. It causes the meanings of a limited
// number of bit combinations following it in the data stream to be changed.
//
// The use of ESC is defined in Standard ECMA-35.
var ESC_ = Sequence{
Name: "ESC",
Desc: "Escape",
Code: []byte(ESC),
}
// IS4 is used to separate and qualify data logically; its specific meaning has
// to be defined for each application. If this control function is used in
// hierarchical order, it may delimit a data item called a file, see 8.2.10.
var IS4_ = Sequence{
Name: "IS4",
Desc: "Information Separator Four (FS - File Separator)",
Code: []byte(IS4),
}
// IS3 is used to separate and qualify data logically; its specific meaning has
// to be defined for each application. If this control function is used in
// hierarchical order, it may delimit a data item called a group, see 8.2.10.
var IS3_ = Sequence{
Name: "IS3",
Desc: "Information Separator Three (GS - Group Separator)",
Code: []byte(IS3),
}
// IS2 is used to separate and qualify data logically; its specific meaning has
// to be defined for each application. If this control function is used in
// hierarchical order, it may delimit a data item called a record, see 8.2.10.
var IS2_ = Sequence{
Name: "IS2",
Desc: "Information Separator Two (RS - Record Separator)",
Code: []byte(IS2),
}
// IS1 is used to separate and qualify data logically; its specific meaning has
// to be defined for each application. If this control function is used in
// hierarchical order, it may delimit a data item called a unit, see 8.2.10.
var IS1_ = Sequence{
Name: "IS1",
Desc: "Information Separator One (US - Unit Separator)",
Code: []byte(IS1),
}
// APC is used as the opening delimiter of a control string for application
// program use. The command string following may consist of bit combinations in
// the range 00/08 to 00/13 and 02/00 to 07/14. The control string is closed by
// the terminating delimiter STRING TERMINATOR (ST). The interpretation of the
// command string depends on the relevant application program.
var APC_ = Sequence{
Name: "APC",
Desc: "Application Program Command",
Type: ESC,
Code: []byte{'_'},
}
// BPH is used to indicate a point where a line break may occur when text is
// formatted. BPH may occur between two graphic characters, either or both of
// which may be SPACE.
var BPH_ = Sequence{
Name: "BPH",
Desc: "Break Permitted Here",
Type: ESC,
Code: []byte{'B'},
}
// CBT causes the active presentation position to be moved to the character
// position corresponding to the n-th preceding character tabulation stop in
// the presentation component, according to the character path, where n equals
// the value of Pn.
var CBT_ = Sequence{
Name: "CBT",
Desc: "Cursor Backward Tabulation",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'Z'},
}
// CCH is used to indicate that both the preceding graphic character in the
// data stream, (represented by one or more bit combinations) including SPACE,
// and the control function CCH itself are to be ignored for further
// interpretation of the data stream.
//
// If the character preceding CCH in the data stream is a control function
// (represented by one or more bit combinations), the effect of CCH is not
// defined by this Standard.
var CCH_ = Sequence{
Name: "CCH",
Desc: "Cancel Character",
Type: ESC,
Code: []byte{'T'},
}
// CHA causes the active presentation position to be moved to character
// position n in the active line in the presentation component, where n equals
// the value of Pn.
var CHA_ = Sequence{
Name: "CHA",
Desc: "Cursor Character Absolute",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'G'},
}
// CHT causes the active presentation position to be moved to the character
// position corresponding to the n-th following character tabulation stop in
// the presentation component, according to the character path, where n equals
// the value of Pn.
var CHT_ = Sequence{
Name: "CHT",
Desc: "Cursor Forward Tabulation",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'I'},
}
// CMD is used as the delimiter of a string of data coded according to Standard
// ECMA-35 and to switch to a general level of control.
//
// The use of CMD is not mandatory if the higher level protocol defines means
// of delimiting the string, for instance, by specifying the length of the
// string.
var CMD_ = Sequence{
Name: "CMD",
Desc: "Coding Method Delimiter",
Type: ESC,
Code: []byte{'d'},
}
// CNL causes the active presentation position to be moved to the first
// character position of the n-th following line in the presentation component,
// where n equals the value of Pn.
var CNL_ = Sequence{
Name: "CNL",
Desc: "Cursor Next Line",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'E'},
}
// CPL causes the active presentation position to be moved to the first
// character position of the n-th preceding line in the presentation component,
// where n equals the value of Pn.
var CPL_ = Sequence{
Name: "CPL",
Desc: "Cursor Preceding Line",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'F'},
}
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to PRESENTATION, CPR is
// used to report the active presentation position of the sending device as
// residing in the presentation component at the n-th line position according
// to the line progression and at the m-th character position according to the
// character path, where n equals the value of Pn1 and m equals the value of
// Pn2.
//
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to DATA, CPR is used to
// report the active data position of the sending device as residing in the
// data component at the n-th line position according to the line progression
// and at the m-th character position according to the character progression,
// where n equals the value of Pn1 and m equals the value of Pn2.
//
// CPR may be solicited by a DEVICE STATUS REPORT (DSR) or be sent unsolicited.
var CPR_ = Sequence{
Name: "CPR",
Desc: "Active Position Report",
Type: CSI,
Notation: "Pn1;Pn2",
NParam: 2,
Defaults: []string{"1", "1"},
Code: []byte{'R'},
}
// CSI is used as the first character of a control sequence, see 5.4.
var CSI_ = Sequence{
Name: "CSI",
Desc: "Control Sequence Introducer",
Type: ESC,
Code: []byte{'['},
}
// CTC causes one or more tabulation stops to be set or cleared in the
// presentation component, depending on the parameter values:
//
// 0 a character tabulation stop is set at the active presentation position
//
// 1 a line tabulation stop is set at the active line (the line that contains
// the active presentation position)
//
// 2 the character tabulation stop at the active presentation position is
// cleared
//
// 3 the line tabulation stop at the active line is cleared
//
// 4 all character tabulation stops in the active line are cleared
//
// 5 all character tabulation stops are cleared
//
// 6 all line tabulation stops are cleared
//
// In the case of parameter values 0, 2 or 4 the number of lines affected
// depends on the setting of the TABULATION STOP MODE (TSM).
var CTC_ = Sequence{
Name: "CTC",
Desc: "Cursor Tabulation Control",
Type: CSI,
Notation: "Ps...",
NParam: -1,
Defaults: []string{"0"},
Code: []byte{'W'},
}
// CUB causes the active presentation position to be moved leftwards in the
// presentation component by n character positions if the character path is
// horizontal, or by n line positions if the character path is vertical, where
// n equals the value of Pn.
var CUB_ = Sequence{
Name: "CUB",
Desc: "Cursor Left",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'D'},
}
// CUD causes the active presentation position to be moved downwards in the
// presentation component by n line positions if the character path is
// horizontal, or by n character positions if the character path is vertical,
// where n equals the value of Pn.
var CUD_ = Sequence{
Name: "CUD",
Desc: "Cursor Down",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'B'},
}
// CUF causes the active presentation position to be moved rightwards in the
// presentation component by n character positions if the character path is
// horizontal, or by n line positions if the character path is vertical, where
// n equals the value of Pn.
var CUF_ = Sequence{
Name: "CUF",
Desc: "Cursor Right",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'C'},
}
// CUP causes the active presentation position to be moved in the presentation
// component to the n-th line position according to the line progression and to
// the m-th character position according to the character path, where n equals
// the value of Pn1 and m equals the value of Pn2.
var CUP_ = Sequence{
Name: "CUP",
Desc: "Cursor Position",
Type: CSI,
Notation: "Pn1;Pn2",
NParam: 2,
Defaults: []string{"1", "1"},
Code: []byte{'H'},
}
// CUU causes the active presentation position to be moved upwards in the
// presentation component by n line positions if the character path is
// horizontal, or by n character positions if the character path is vertical,
// where n equals the value of Pn.
var CUU_ = Sequence{
Name: "CUU",
Desc: "Cursor Up",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'A'},
}
// CVT causes the active presentation position to be moved to the corresponding
// character position of the line corresponding to the n-th following line
// tabulation stop in the presentation component, where n equals the value of
// Pn.
var CVT_ = Sequence{
Name: "CVT",
Desc: "Cursor Line Tabulation",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'Y'},
}
// With a parameter value not equal to 0, DA is used to identify the device
// which sends the DA. The parameter value is a device type identification code
// according to a register which is to be established. If the parameter value
// is 0, DA is used to request an identifying DA from a device.
var DA_ = Sequence{
Name: "DA",
Desc: "Device Attributes",
Type: CSI,
Notation: "Ps",
NParam: 1,
Defaults: []string{"0"},
Code: []byte{'c'},
}
// DAQ is used to indicate that the active presentation position in the
// presentation component is the first character position of a qualified area.
// The last character position of the qualified area is the character position
// in the presentation component immediately preceding the first character
// position of the following qualified area.
//
// The parameter value designates the type of qualified area:
//
// 0 unprotected and unguarded
//
// 1 protected and guarded
//
// 2 graphic character input
//
// 3 numeric input
//
// 4 alphabetic input
//
// 5 input aligned on the last character position of the qualified area
//
// 6 fill with ZEROs
//
// 7 set a character tabulation stop at the active presentation position (the
// first character position of the qualified area) to indicate the beginning of
// a field
//
// 8 protected and unguarded
//
// 9 fill with SPACEs
//
// 10 input aligned on the first character position of the qualified area
//
// 11 the order of the character positions in the input field is reversed, i.e.
// the last position in each line becomes the first and vice versa; input
// begins at the new first position.
//
// This control function operates independently of the setting of the
// TABULATION STOP MODE (TSM). The character tabulation stop set by parameter
// value 7 applies to the active line only.
//
// NOTE
//
// The control functions for area definition (DAQ, EPA, ESA, SPA, SSA) should
// not be used within an SRS string or an SDS string.
var DAQ_ = Sequence{
Name: "DAQ",
Desc: "Define Area Qualification",
Type: CSI,
Notation: "Ps...",
NParam: -1,
Defaults: []string{"0"},
Code: []byte{'o'},
}
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to PRESENTATION, DCH
// causes the contents of the active presentation position and, depending on
// the setting of the CHARACTER EDITING MODE (HEM), the contents of the n-1
// preceding or following character positions to be removed from the
// presentation component, where n equals the value of Pn. The resulting gap is
// closed by shifting the contents of the adjacent character positions towards
// the active presentation position. At the other end of the shifted part, n
// character positions are put into the erased state.
//
// The extent of the shifted part is established by SELECT EDITING EXTENT (SEE).
//
// The effect of DCH on the start or end of a selected area, the start or end
// of a qualified area, or a tabulation stop in the shifted part is not defined
// by this Standard.
//
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to DATA, DCH causes the
// contents of the active data position and, depending on the setting of the
// CHARACTER EDITING MODE (HEM), the contents of the n-1 preceding or following
// character positions to be removed from the data component, where n equals
// the value of Pn. The resulting gap is closed by shifting the contents of the
// adjacent character positions towards the active data position. At the other
// end of the shifted part, n character positions are put into the erased state.
var DCH_ = Sequence{
Name: "DCH",
Desc: "Delete Character",
Type: CSI,
Notation: "Pn",
NParam: 1,
Defaults: []string{"1"},
Code: []byte{'P'},
}
// DCS is used as the opening delimiter of a control string for device control
// use. The command string following may consist of bit combinations in the
// range 00/08 to 00/13 and 02/00 to 07/14. The control string is closed by the
// terminating delimiter STRING TERMINATOR (ST).
//
// The command string represents either one or more commands for the receiving
// device, or one or more status reports from the sending device. The purpose
// and the format of the command string are specified by the most recent
// occurrence of IDENTIFY DEVICE CONTROL STRING (IDCS), if any, or depend on
// the sending and/or the receiving device.
var DCS_ = Sequence{
Name: "DCS",
Desc: "Device Control String",
Type: ESC,
Code: []byte{'P'},
}
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to PRESENTATION, DL causes
// the contents of the active line (the line that contains the active
// presentation position) and, depending on the setting of the LINE EDITING
// MODE (VEM), the contents of the n-1 preceding or following lines to be
// removed from the presentation component, where n equals the value of Pn. The
// resulting gap is closed by shifting the contents of a number of adjacent
// lines towards the active line. At the other end of the shifted part, n lines
// are put into the erased state.
//
// The active presentation position is moved to the line home position in the
// active line. The line home position is established by the parameter value of
// SET LINE HOME (SLH). If the TABULATION STOP MODE (TSM) is set to SINGLE,
// character tabulation stops are cleared in the lines that are put into the
// erased state.
//
// The extent of the shifted part is established by SELECT EDITING EXTENT (SEE).
//
// Any occurrences of the start or end of a selected area, the start or end of
// a qualified area, or a tabulation stop in the shifted part, are also shifted.
//
// If the DEVICE COMPONENT SELECT MODE (DCSM) is set to DATA, DL causes the
// contents of the active line (the line that contains the active data
// position) and, depending on the setting of the LINE EDITING MODE (VEM), the
// contents of the n-1 preceding or following lines to be removed from the data
// component, where n equals the value of Pn. The resulting gap is closed by
// shifting the contents of a number of adjacent lines towards the active line.
// At the other end of the shifted part, n lines are put into the erased state.
// The active data position is moved to the line home position in the active
// line. The line home position is established by the parameter value of SET
// LINE HOME (SLH).
var DL_ = Sequence{
Name: "DL",
Desc: "Delete Line",