Repository navigation
fix(vtquery): answer device-status DSR with CSI 0 n - #144
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #143
A program on the panel PTY that sends device-status DSR (
CSI 5 n) now readsCSI 0 nback on that PTY.ptymgr.pumpalready writes whatevervtquery.Replyreturns; 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.Stripstill removesCSI … nbefore that emulator, so it does not also inject a reply.The bytes are
CSI 0 n. The client x/vt emulator would emitCSI ? 0 nfor this query, because it builds the report from a DEC status type. A terminal answers withCSI 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=1go test ./internal/ptymgr/ -run TestPumpAnswers -count=1(the program reads1b5b306e,CSI 0 n, after writingCSI 5 n)go test ./internal/server/ -run 'TestStripReplay|TestReplay' -count=1