MCPcopy
hub / github.com/liamg/darktile / csiDeviceStatusReportHandler

Method csiDeviceStatusReportHandler

internal/app/darktile/termutil/csi.go:322–340  ·  view source on GitHub ↗

CSI n Device Status Report (DSR)

(params []string)

Source from the content-addressed store, hash-verified

320// CSI n
321// Device Status Report (DSR)
322func (t *Terminal) csiDeviceStatusReportHandler(params []string) (renderRequired bool) {
323
324 if len(params) == 0 {
325 return false
326 }
327
328 switch params[0] {
329 case "5":
330 t.WriteToPty([]byte("\x1b[0n")) // everything is cool
331 case "6": // report cursor position
332 t.WriteToPty([]byte(fmt.Sprintf(
333 "\x1b[%d;%dR",
334 t.GetActiveBuffer().CursorLine()+1,
335 t.GetActiveBuffer().CursorColumn()+1,
336 )))
337 }
338
339 return false
340}
341
342// CSI A
343// Cursor Up Ps Times (default = 1) (CUU)

Callers 1

handleCSIMethod · 0.95

Calls 4

WriteToPtyMethod · 0.95
GetActiveBufferMethod · 0.95
CursorLineMethod · 0.80
CursorColumnMethod · 0.80

Tested by

no test coverage detected