Skip to main content

Module control_sequences

Module control_sequences 

Source
Expand description

Control Sequences.

A control sequence is a string of bit combinations starting with the control function Control Sequence Introducer (CSI), followed by one or more bit combinations representing parameters, if any, and by one or more bit combinations identifying the control function. The control function CSI itself is an element of the C1 set.

§Usage

You can use the control sequences inside normal strings, format them with the format!() macro, or print them with the print!() and println!() macros.

For example, move the cursor to line 5, character 13:

use ansi_control_codes::control_sequences::CUP;
print!("{}", CUP(Some(5), Some(13)));

§Overview of the Control Sequences

§Without Intermediate Bytes

Row NumberColumn 04Column 05Column 06
00ICHDCHHPA
01CUUSEEHPR
02CUDCPRREP
03CUFSUDA
04CUBSDVPA
05CNLNPVPR
06CPLPPHVP
07CHACTCTBC
08CUPECHSM
09CHTCVTMC
10EDCBTHPB
11ELSRSVPB
12ILPTXRM
13DLSDSSGR
14EFSIMDDSR
15EADAQ

§With Intermediate Bytes 02/00

Row NumberColumn 04Column 05Column 06
00SLPPATATE
01SRPPRTALE
02GSMPPBTAC
03GSSSPDTCC
04FNTDTATSR
05TSSSLHSCO
06JFYSLLSRCS
07SPIFNKSCS
08QUADSPQRSLS
09SSUSEFSPH
10PFSPECSPL
11SHSSSWSCP
12SVSSACS
13IGSSAPV
14STAB
15IDCSGCC

§Note

As intended by the standard, notation of control functions is kept identical to the definitions in the standard. This means that functions in this rust module will not follow the standard snake_case rust naming convention, but instead follow the ECMA standard. This is intended.

Enums§

Alignment
Valid parameter values to the function QUAD.
AreaQualification
Valid parameter values to the function DAQ.
CharacterOrientation
Valid parameter values to the function SCO.
CharacterPath
Valid parameter values to the function SCP.
CharacterPathScope
Valid parameter values to the function SCP.
CharacterSpacing
Valid parameter values to the function SHS.
ClearTabulation
Valid parameter values to the function TBC.
DeviceAttributes
Valid parameter values to the function DA.
DeviceStatusReport
Valid parameter values to the function DSR.
EditingExtend
Valid parameter values to the function SEE.
EraseArea
Valid parameter values to the function EA.
EraseField
Valid parameter values to the function EF.
EraseLine
Valid parameter values to the function EL.
ErasePage
Valid parameter values to the function ED.
Font
Valid parameter values to the function FNT.
GraphicCharacterCombination
Valid parameter values to the function GCC.
GraphicRendition
Valid parameter values to the function SGR.
IdentifyDeviceControlString
Valid parameter values to the function IDCS.
Justification
Valid parameter values to the function JFY.
LineSpacing
Valid parameter values to the function SLS.
Load
Valid parameter values to the function SEF.
MediaCopy
Valid parameter values to the function MC.
MovementDirection
Valid parameter values to the function SIMD.
PageFormat
Valid parameter values to the function PFS.
ParallelText
Valid parameter values to the function PTX.
PresentationDirection
Valid parameter values to the function SPD.
PresentationDirectionScope
Valid parameter values to the function SPD.
PresentationExpandContract
Valid parameter values to the function PEC.
PresentationVariant
Valid parameter values to the function SAPV.
PrintQuality
Valid parameter values to the function SPQR.
ReversedString
Valid parameter values to the function SRS.
SizeUnit
Valid parameter values to the function SSU.
Stack
Valid parameter values to the function SEF.
StringDirection
Valid parameter values to the function SDS.
TabulationControl
Valid parameter values to the function CTC.

Functions§

CBT
Cursor Backward Tabulation.
CHA
Cursor Character Absolute.
CHT
Cursor Forward Tabulation.
CNL
Cursor Next Line.
CPL
Cursor Preceding Line.
CPR
Active Position Report.
CTC
Cursor Tabulation Control.
CUB
Cursor Left.
CUD
Cursor Down.
CUF
Cursor Right.
CUP
Cursor Position.
CUU
Cursor Up.
CVT
Cursor Line Tabulation.
DA
Device Attributes.
DAQ
Define Area Qualification.
DCH
Delete Character.
DL
Delete Line.
DSR
Device Status Report.
DTA
Dimension Text Area.
EA
Erase in Area.
ECH
Erase Character.
ED
Erase In Page.
EF
Erase In Field.
EL
Erase In Line.
FNK
Function Key.
FNT
Font Selection.
GCC
Graphic Character Combination
GSM
Graphic Size Modification.
GSS
Graphic Size Selection.
HPA
Character Position Absolute.
HPB
Character Position Backward.
HPR
Character Position Forward.
HVP
Character And Line Position.
ICH
Insert Character.
IDCS
Identify Device Control String.
IGS
Identify Graphic Subrepertoire.
IL
Insert Line.
JFY
Justify.
MC
Media Copy.
NP
Next Page.
PEC
Presentation Expand or Contract.
PFS
Page Format Selection
PP
Preceding Page.
PPA
Page Position Absolute.
PPB
Page Position Backward.
PPR
Page Position Forward.
PTX
Parallel Texts.
QUAD
Quad.
REP
Repeat.
RM
Reset Mode.
SACS
Set Additional Character Representation.
SAPV
Select Alternative Presentation Variants.
SCO
Select Character Orientation.
SCP
Select Character Path.
SCS
Set Character Spacing.
SD
Scroll Down.
SDS
Start Directed String.
SEE
Select Editing Extent.
SEF
Sheet Eject And Feed.
SGR
Select Graphic Rendition.
SHS
Select Character Spacing.
SIMD
Select Implicit Movement Direction.
SL
Scroll Left.
SLH
Set Line Home.
SLL
Set Line Limit.
SLS
Set Line Spacing.
SM
Set Mode.
SPD
Select Presentation Directions.
SPH
Set Page Home.
SPI
Spacing Increment.
SPL
Set Page Limit.
SPQR
Select Print Quality and Rapidity.
SR
Scroll Right.
SRCS
Set Reduced Character Separation.
SRS
Start Reversed String.
SSU
Select Size Unit.
SSW
Set Space Width.
STAB
Selective Tabulation.
SU
Scroll Up.
SVS
Select Line Spacing.
TAC
Tabulation Aligned Centred.
TALE
Tabulation Aligned Leading Edge.
TATE
Tabulation Aligned Trailing Edge.
TBC
Tabulation Clear.
TCC
Tabulation Centred on Character.
TSR
Tabulation Stop Remove.
TSS
Thin Space Specification.
VPA
Line Position Absolute.
VPB
Line Position Backward.
VPR
Line Position Forward.