set _cur_x 0
}
- # Make room for characters.
+ # Insert Character.
+ #
+ # https://vt100.net/docs/vt510-rm/ICH.html
proc _csi_@ {args} {
set n [_default [lindex $args 0] 1]
variable _cur_x
}
# Cursor Up.
+ #
+ # https://vt100.net/docs/vt510-rm/CUU.html
proc _csi_A {args} {
variable _cur_y
set arg [_default [lindex $args 0] 1]
}
# Cursor Down.
+ #
+ # https://vt100.net/docs/vt510-rm/CUD.html
proc _csi_B {args} {
variable _cur_y
variable _rows
}
# Cursor Forward.
+ #
+ # https://vt100.net/docs/vt510-rm/CUF.html
proc _csi_C {args} {
variable _cur_x
variable _cols
set _cur_x [expr {min ($_cur_x + $arg, $_cols)}]
}
- # Cursor Back.
+ # Cursor Backward.
+ #
+ # https://vt100.net/docs/vt510-rm/CUB.html
proc _csi_D {args} {
variable _cur_x
set arg [_default [lindex $args 0] 1]
}
# Cursor Next Line.
+ #
+ # https://vt100.net/docs/vt510-rm/CNL.html
proc _csi_E {args} {
variable _cur_x
variable _cur_y
}
# Cursor Previous Line.
+ #
+ # https://vt100.net/docs/vt510-rm/CPL.html
proc _csi_F {args} {
variable _cur_x
variable _cur_y
}
# Cursor Horizontal Absolute.
+ #
+ # https://vt100.net/docs/vt510-rm/CHA.html
proc _csi_G {args} {
variable _cur_x
variable _cols
set _cur_x [expr {min ($arg - 1, $_cols)}]
}
- # Move cursor (don't know the official name of this one).
+ # Cursor Position.
+ #
+ # https://vt100.net/docs/vt510-rm/CUP.html
proc _csi_H {args} {
variable _cur_x
variable _cur_y
set _cur_x [expr {[_default [lindex $args 1] 1] - 1}]
}
- # Cursor Forward Tabulation.
+ # Cursor Horizontal Forward Tabulation.
+ #
+ # https://vt100.net/docs/vt510-rm/CHT.html
proc _csi_I {args} {
set n [_default [lindex $args 0] 1]
variable _cur_x
}
}
- # Erase.
+ # Erase in Display.
+ #
+ # https://vt100.net/docs/vt510-rm/ED.html
proc _csi_J {args} {
variable _cur_x
variable _cur_y
}
}
- # Erase Line.
+ # Erase in Line.
+ #
+ # https://vt100.net/docs/vt510-rm/EL.html
proc _csi_K {args} {
variable _cur_x
variable _cur_y
}
}
- # Delete lines.
+ # Delete line.
+ #
+ # https://vt100.net/docs/vt510-rm/DL.html
proc _csi_M {args} {
variable _cur_y
variable _rows
}
# Erase chars.
+ #
+ # https://vt100.net/docs/vt510-rm/ECH.html
proc _csi_X {args} {
set n [_default [lindex $args 0] 1]
# Erase characters but don't move cursor.
}
}
- # Backward tab stops.
+ # Cursor Backward Tabulation.
+ #
+ # https://vt100.net/docs/vt510-rm/CBT.html
proc _csi_Z {args} {
set n [_default [lindex $args 0] 1]
variable _cur_x
}
# Repeat.
+ #
+ # https://www.xfree86.org/current/ctlseqs.html (See `(REP)`)
proc _csi_b {args} {
variable _last_char
set n [_default [lindex $args 0] 1]
_insert [string repeat $_last_char $n]
}
- # Line Position Absolute.
+ # Vertical Line Position Absolute.
+ #
+ # https://vt100.net/docs/vt510-rm/VPA.html
proc _csi_d {args} {
variable _cur_y
set _cur_y [expr {[_default [lindex $args 0] 1] - 1}]
}
# Select Graphic Rendition.
+ #
+ # https://vt100.net/docs/vt510-rm/SGR.html
proc _csi_m {args} {
variable _attrs
foreach item $args {