Skip to content

DECRPM: missing dynamic mode reports for cursor blink and save cursor #28

@ona-automations

Description

@ona-automations

Problem

requestMode (CSI ? $ p) returns NOT_RECOGNIZED (Pm=0) for DEC private modes 12 (cursor blink) and 1048 (save cursor) that upstream xterm.js reports with dynamic values.

Mode Type Upstream Response Go Port Response
12 (att610 cursor blink) DEC private SET/RESET based on cursorBlink option NOT_RECOGNIZED (0)
1048 (save cursor) DEC private SET (1) always NOT_RECOGNIZED (0)

Reproduction

term := xterm.New(xterm.WithCols(80), xterm.WithRows(24))
defer term.Dispose()
var resp string
term.OnData(func(data string) { resp += data })

// DEC private mode 12 — should respond based on cursorBlink option
term.WriteString("\x1b[?12$p")
// Got: "\x1b[?12;0$y" (NOT_RECOGNIZED)
// Want: "\x1b[?12;2$y" (RESET, since cursorBlink defaults to false)

// DEC private mode 1048 — should always respond SET
term.WriteString("\x1b[?1048$p")
// Got: "\x1b[?1048;0$y" (NOT_RECOGNIZED)
// Want: "\x1b[?1048;1$y" (SET)

Fix

In inputhandler_csi.go, add cases to privateModeSetting:

case 12:
    return boolToPm(h.optionsService.Options.CursorBlink)
case 1048:
    return 1 // always SET per xterm behavior

Upstream Reference

  • File: src/common/InputHandler.ts, method requestMode, lines 2330–2395
  • Commit: 6ba731d73bfbe074e84b57abb62080bed2f4db03

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions