Skip to content

fix(vtquery): answer device-status DSR with CSI 0 n - #144

Merged
cmj0121 merged 2 commits into
mainfrom
feat/answer-status-dsr
Oct 12, 2026
Merged

cmj0121 merged 2 commits into
mainfrom
feat/answer-status-dsr

Conversation

@cmj0121

@cmj0121 cmj0121 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closes #143

A program on the panel PTY that sends device-status DSR (CSI 5 n) now reads CSI 0 n back on that PTY. ptymgr.pump already writes whatever vtquery.Reply returns; the reply is the ready report, and it is written on the same read that carried the query.

Ps is exactly 5. Leading zeros (CSI 05 n) are that same parameter. A private marker (CSI ? 5 n), a second parameter (CSI 5 ; 6 n), parameter 15, and parameter 50 get no server reply. Cursor-position DSR (CSI 6 n, CSI ? 6 n) stays unanswered: the row and column live on the client emulator's screen. Strip still removes CSI … n before that emulator, so it does not also inject a reply.

The bytes are CSI 0 n. The client x/vt emulator would emit CSI ? 0 n for this query, because it builds the report from a DEC status type. A terminal answers with CSI 0 n, which is the sequence the caller binds.

DECRQM, colour queries, XTVERSION, and the in-band-resize report are unchanged.

Test plan

  • go test ./internal/vtquery/ -count=1
  • go test ./internal/ptymgr/ -run TestPumpAnswers -count=1 (the program reads 1b5b306e, CSI 0 n, after writing CSI 5 n)
  • go test ./internal/server/ -run 'TestStripReplay|TestReplay' -count=1
  • CI green on Linux

CSI 5 n on a panel PTY now gets CSI 0 n, the ready report, written back
on the same read as a device-attributes reply. Ps is exactly 5, and
leading zeros count as that parameter. Cursor position, a private
marker, and a second parameter stay unanswered. The bytes are CSI 0 n:
that is the report a terminal sends, and the sequence a readline macro
waits on.
Leading zeros, an embedded query, and a mix with DA come back in order.
Parameter 15, parameter 50, a private marker, a second parameter, and
both cursor reports stay empty. The pump test reads CSI 0 n back on the
program's stdin after it writes CSI 5 n.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.37%. Comparing base (7f53a27) to head (adcca51).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
- Coverage   88.38%   88.37%   -0.01%     
==========================================
  Files         151      151              
  Lines       23462    23465       +3     
==========================================
+ Hits        20736    20737       +1     
- Misses       1926     1927       +1     
- Partials      800      801       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cmj0121
cmj0121 merged commit cb7e1c8 into main Oct 12, 2026
2 checks passed
@cmj0121
cmj0121 deleted the feat/answer-status-dsr branch October 12, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Answer device-status DSR (CSI 5 n) with CSI 0 n on the panel PTY

2 participants