vt/csi_screen.go
raw| 1 | package vt |
| 2 | |
| 3 | import ( |
| 4 | uv "github.com/charmbracelet/ultraviolet" |
| 5 | ) |
| 6 | |
| 7 | // eraseCharacter erases n characters starting from the cursor position. It |
| 8 | // does not move the cursor. This is equivalent to [ansi.ECH]. |
| 9 | func (e *Emulator) eraseCharacter(n int) { |
| 10 | if n <= 0 { |
| 11 | n = 1 |
| 12 | } |
| 13 | x, y := e.scr.CursorPosition() |
| 14 | rect := uv.Rect(x, y, n, 1) |
| 15 | e.scr.FillArea(e.scr.blankCell(), rect) |
| 16 | e.atPhantom = false |
| 17 | // ECH does not move the cursor. |
| 18 | } |