| 1 |
package vt |
| 2 |
|
| 3 |
import "github.com/charmbracelet/x/ansi" |
| 4 |
|
| 5 |
// handleDcs handles a DCS escape sequence. |
| 6 |
func (e *Emulator) handleDcs(cmd ansi.Cmd, params ansi.Params, data []byte) { |
| 7 |
e.flushGrapheme() // Flush any pending grapheme before handling DCS sequences. |
| 8 |
if !e.handlers.handleDcs(cmd, params, data) { |
| 9 |
e.logf("unhandled sequence: DCS %q %q", paramsString(cmd, params), data) |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
// handleApc handles an APC escape sequence. |
| 14 |
func (e *Emulator) handleApc(data []byte) { |
| 15 |
e.flushGrapheme() // Flush any pending grapheme before handling APC sequences. |
| 16 |
if !e.handlers.handleApc(data) { |
| 17 |
e.logf("unhandled sequence: APC %q", data) |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
// handleSos handles an SOS escape sequence. |
| 22 |
func (e *Emulator) handleSos(data []byte) { |
| 23 |
e.flushGrapheme() // Flush any pending grapheme before handling SOS sequences. |
| 24 |
if !e.handlers.handleSos(data) { |
| 25 |
e.logf("unhandled sequence: SOS %q", data) |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
// handlePm handles a PM escape sequence. |
| 30 |
func (e *Emulator) handlePm(data []byte) { |
| 31 |
e.flushGrapheme() // Flush any pending grapheme before handling PM sequences. |
| 32 |
if !e.handlers.handlePm(data) { |
| 33 |
e.logf("unhandled sequence: PM %q", data) |
| 34 |
} |
| 35 |
} |