Skip to content

vtf iodata textctrl

srccircumflex edited this page Apr 24, 2023 · 4 revisions

↑ vtf-iodata

textctrl

The module provides factory methods categorized in classes for escape sequences of text control and modification.

CharSet for character set selection; Erase to erase a specific range of characters from the terminal and TextModification for character positioning, precise erasing and more.

Also look in module sgr for the "Select Graphic Rendition" (SGR), the sequence for the text styling.

Module contents

Objects

Factory Classes

class textctrl.CharSet

Select character set: (.select)
ESC ...
  • % @ : Default (ISO 8859-1)
  • % G : UTF-8
Designate character set: (.designate*)
ESC ...
  • ( : Designate G0 Character Set (VT100) [i] Windows / UNIX compatible
  • ) : Designate G1 Character Set (VT100)
  • * : Designate G2 Character Set (VT220)
  • + : Designate G3 Character Set (VT220)
Parameters:
  • A : UK (VT100)
  • B : USASCII (VT100) [i] Windows / UNIX compatible
  • C : Finnish (VT200)
  • H : Swedish (VT200)
  • K : German (VT200)
  • Q : French Canadian (VT200)
  • R : French (VT200)
  • y : Italian (VT200)
  • Z : Spanish (VT200)
  • 4 : Dutch (VT200)
  • " > : Greek (VT500)
  • % 2 : Turkish (VT500)
  • % 6 : Portuguese (VT300)
  • % = : Hebrew (VT500)
  • = : Swiss (VT200)
  • E : Norwegian (VT200)
  • 0 : DEC Special Characters and Line Drawing (VT100) [i] Windows / UNIX compatible
  • < : DEC Supplemental (VT200)
  • > : DEC Technical (VT300)
  • " 4 : DEC Hebrew (VT500)
  • " ? : DEC Greek (VT500)
  • % 0 : DEC Turkish (VT500)
  • % 5 : DEC Supplemental Graphics (VT300)
  • & 4 : DEC Cyrillic (VT500)
  • % 3 : SCS NRCS (VT500)
  • & 5 : DEC Russian (VT500)
Designate character set (VT >= 300): (.designate*)
ESC ...
  • - : Designate G1 Character Set (VT300)
  • . : Designate G2 Character Set (VT300)
  • / : Designate G3 Character Set (VT300)
Parameters:
  • A : ISO Latin-1 Supplemental (VT300)
  • B : ISO Latin-2 Supplemental (VT500)
  • F : ISO Greek Supplemental (VT500)
  • H : ISO Hebrew Supplemental (VT500)
  • L : ISO Latin-Cyrillic (VT500)
  • M : ISO Latin-5 Supplemental (VT500)
Invoke character set: (.invoke)
ESC ...
  • [LS2] n : Invoke the G2 Character Set as GL
  • [LS3] o : Invoke the G3 Character Set as GL
  • [LS3R] | : Invoke the G3 Character Set as GR
  • [LS2R] } : Invoke the G2 Character Set as GR
  • [LS1R] ~ : Invoke the G1 Character Set as GR (VT100)
# Resources:
; microsoft/console-virtual-terminal-sequences/designate-character-set ; xterm/Controls-beginning-with-ESC

staticmethod designateG0_VT100(param) -> FsFpnF

ESC ( { param }

Designate G0 Character Set (VT100).

staticmethod designateG1_VT100(param) -> FsFpnF

ESC ) { param }

Designate G1 Character Set (VT100).

staticmethod designateG1_VT300(param) -> FsFpnF

ESC - { param }

Designate G1 Character Set (VT300).

staticmethod designateG2_VT220(param) -> FsFpnF

ESC * { param }

Designate G2 Character Set (VT220).

staticmethod designateG2_VT300(param) -> FsFpnF

ESC . { param }

Designate G2 Character Set (VT300).

staticmethod designateG3_VT220(param) -> FsFpnF

ESC + { param }

Designate G3 Character Set (VT220).

staticmethod designateG3_VT300(param) -> FsFpnF

ESC { param }

Designate G3 Character Set (VT300).

staticmethod invoke(param) -> FsFpnF

ESC { param }

Invoke character set.

staticmethod select(utf8=False) -> FsFpnF

ESC %G (UTF8) | ESC %@ (ISO 8859-1, default)

Select character set.

class textctrl.Erase

VT100:
  • [ED] CSI 0 J (.display_below) [i] Windows / UNIX compatible
  • [ED] CSI 1 J (.display_above) [i] Windows / UNIX compatible
  • [ED] CSI 2 J (.display) [i] Windows / UNIX compatible
  • [ED] CSI 3 J (.display_lines)
  • [EL] CSI 0 K (.line_right) [i] Windows / UNIX compatible
  • [EL] CSI 1 K (.line_left) [i] Windows / UNIX compatible
  • [EL] CSI 2 K (.line) [i] Windows / UNIX compatible
  • [RIS] ESC c (.terminal)

Term: VT100

VT220: (selective erase)
  • [DECSED] CSI ? 0 J (.display_below) (default)
  • [DECSED] CSI ? 1 J (.display_above)
  • [DECSED] CSI ? 2 J (.display)
  • [DECSED] CSI ? 3 J (.display_lines)
  • [DECSEL] CSI ? 0 K (.line_right)
  • [DECSEL] CSI ? 1 K (.line_left)
  • [DECSEL] CSI ? 2 K (.line)
  • [DECSTR] CSI ! p (.terminal) [i] Windows / UNIX compatible

Term: VT220

# Resources:
; microsoft/console-virtual-terminal-sequences/text-modification ; microsoft/console-virtual-terminal-sequences/soft-reset ; xterm/CSI

staticmethod display(vt100=True) -> CSI

CSI 2 J (VT100, default) | CSI ? 2 J (VT220)

Erase all displayed lines.

staticmethod display_above(vt100=True) -> CSI

CSI 1 J (VT100, default) | CSI ? 1 J (VT220)

Erase displayed lines above.

staticmethod display_below(vt100=True) -> CSI

CSI 0 J (VT100, default) | CSI ? 0 J (VT220)

Erase displayed lines below.

staticmethod display_lines(vt100=True) -> CSI

CSI 3 J (VT100, default) | CSI ? 3 J (VT220)

Erase saved lines.

Term: xterm

staticmethod line(vt100=True) -> CSI

CSI 2 K (VT100, default) | CSI ? 2 K (VT220)

Erase the whole line.

staticmethod line_left(vt100=True) -> CSI

CSI 1 K ( VT100, default) | CSI ? 1 K (VT220)

Erase the left side of the line.

staticmethod line_right(vt100=True) -> CSI

CSI 0 K (VT100, default) | CSI ? 0 K (VT220)

Erase the right side of the line.

staticmethod terminal(vt100=True) -> FsFpnF | CSI

ESC c (VT100, default) | CSI ! p (VT220)

Terminal reset.

class textctrl.TextModification

Character positioning

  • [HPR] CSI n=1 a (.chr_pos_rel)
  • [HPA] CSI n=1 ` (.chr_pos_abs)
  • [ICH] CSI n=1 @ (.ins_chr) [i] Windows / UNIX compatible
  • [DCH] CSI n=1 P (.del_chr) [i] Windows / UNIX compatible
  • [ECH] CSI n=1 X (.erase_chr) [i] Windows / UNIX compatible
  • [IL] CSI n=1 L (.ins_ln) [i] Windows / UNIX compatible
  • [DL] CSI n=1 M (.del_ln) [i] Windows / UNIX compatible
# Resources:
; microsoft/console-virtual-terminal-sequences/text-modification ; xterm/CSI

staticmethod chr_pos_abs(n=1) -> CSI

CSI { n } `

Character to position n -- absolute (HPA).

staticmethod chr_pos_rel(n=1) -> CSI

CSI { n } a

Character to position n -- relative (HPR).

staticmethod del_chr(n=1) -> CSI

CSI { n } P

Delete n characters (DCH).

staticmethod del_ln(n=1) -> CSI

CSI { n } M

Delete n lines (DL).

staticmethod erase_chr(n=1) -> CSI

CSI { n } X

Erase n characters (ECH).

staticmethod ins_chr(n=1) -> CSI

CSI { n } @

Insert n blank characters (ICH).

staticmethod ins_ln(n=1) -> CSI

CSI { n } L

Insert n lines (IL).


Date: 07 Nov 2022
Version: 0.1
Author: Adrian Hoefflin [srccircumflex]
Doc-Generator: "pyiStructure-RSTGenerator" <prototype>
Clone this wiki locally