fix: DSR replies to bare CSI n (missing default status-report parameter) - #28
Merged
loki5512344 merged 1 commit intoAug 27, 2026
Merged
Conversation
DSR (CSI Ps n) declared no defaultParameters, so a bare CSI n (Ps omitted
-> args[0]==0) matched neither the args[0]==5 (status) nor args[0]==6 (CPR)
branch and produced no reply. A guest sending a bare status query then
hangs waiting for \033[0n that never comes (§36 m4).
Add defaultParameters returning {5}. CSIManager substitutes a 0/omitted
slot with the handler's declared default BEFORE execute runs (it iterates
defaults.length, so the default fires even at argCount==0), so bare CSI n
now resolves to Ps=5 -> \033[0n. This matches ECMA-48 / common terminal
behavior (Ps=0 treated as Ps=5 for status). CSI 5 n is unchanged (args[0]
==5, no substitution); CSI 6 n (CPR) is unchanged; CSI ? n (DECDSR) path
is untouched.
Tests: dsrBareCsiNRepliesStatus (bare CSI n -> \033[0n) and dsrExplicit-
FiveStillRepliesStatus (explicit 5 unchanged), reading the reply via
terminal.io.getInput(). Revert-and-fail proven: removing defaultParameters
fails the bare-CSI-n test (no reply -> assertNotNull fails). 102/0.
QA: clean build (compileJava + compileTestJava ran, not cached), full
suite green; PMD main 0 (preserved zero-violation baseline), Checkstyle 0
in touched files (the 1 main warning is pre-existing in DeltaFrameCodec),
SpotBugs delta 0.
Assisted by: GLM (syn:large:text on synthetic.new) — code generation and review.
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.
DSR (
CSI Ps n) declared nodefaultParameters, so a bareCSI n(Ps omitted →args[0]==0) matched neither theargs[0]==5(status) norargs[0]==6(CPR) branch and produced no reply. A guest sending a bare status query then hangs waiting for\033[0nthat never comes (§36 m4).What this does
defaultParametersreturning{5}. CSIManager substitutes a0/omitted slot with the handler's declared default beforeexecuteruns (it iteratesdefaults.length, so the default fires even atargCount==0), so bareCSI nresolves toPs=5→\033[0n. This matches ECMA-48 / common terminal behavior (Ps=0 treated as Ps=5 for status).CSI 5 n(args[0]==5, no substitution),CSI 6 n(CPR), and theCSI ? n(DECDSR) path.executeparams — same group as CHA/VPA/DA).Verification
TerminalBufferTest, 102/0.dsrBareCsiNRepliesStatus(bareCSI n→\033[0n) anddsrExplicitFiveStillRepliesStatus(explicit 5 unchanged), reading the reply viaterminal.io.getInput().defaultParametersfails the bare-CSI-n test (no reply →assertNotNullfails).compileJava+compileTestJavaran, not cached); full suite green.QA gate
DeltaFrameCodec.java); SpotBugs delta 0.Assisted by: GLM (syn:large:text on synthetic.new) — code generation and review.