Fix device attributes report for VT100 features - #64
Conversation
Agent-Logs-Url: https://github.com/tomlm/XTerm.NET/sessions/ce8fccb7-68cb-4a0f-8f1d-40cb56a1cb7c Co-authored-by: tomlm <17789481+tomlm@users.noreply.github.com>
Perf comparison3 run(s) of each side, alternating on one machine. Allocation is a count and is gated exactly. Time is a measurement, so its gate is derived from the spread this job just observed in itself rather than fixed in advance.
Each corpus is gated at assemblies measured
|
|
@claude, take over this issue/pr, it's yours now |
|
Claude finished @tomlm's task in 12m 37s —— View job Took over PR #64 — device attributes now describe this emulator
What was wrong with the WIP reply
Checked one at a time against the tree:
Two of the absent ones have teeth. A program that reads What it reports now
Two more things that fell out of reading the same handler
Tests updated for the new replies, plus two new ones covering the non-zero parameter and the tertiary request.
|
The DA reply is a promise. Every attribute in it names a sequence the program will now go ahead and send, so listing one the emulator does not implement does not flatter it, it breaks it: the sequence goes out, nothing happens, and the screen the program believes it drew is not the screen that is there. The WIP reply, CSI ? 64 ; 1 ; 2 ; 4 ; 6 ; 9 ; 15 ; 21 ; 22 c, is xterm's list rather than this code's. Checked one at a time against the tree: 132 columns is not implemented (TerminalMode.ColumnMode is in the enum, SetCSIMode has no case for it), there is no media copy command, no DECSCA, no national replacement sets (Charsets holds the default, the line drawing set and UK), no technical characters, and no left and right margins. Two of those have teeth -- a program that reads 21 sets margins and draws inside them, and one that reads 2 pushes a print job through a printer-controller mode we never enter, so it lands on the screen. What is left is what is real: CSI ? 62 ; 22 c, a VT220 with ANSI colour, plus 4 when Sixel is switched on, which is the one attribute programs visibly act on. Secondary DA now says terminal type 1, a VT220, so it agrees with the 62 instead of contradicting it as the old 0 did, and carries the package version as Pv. Two smaller things fall out of reading the same handler. A DA with a non-zero parameter is a reply, not a request, and answering it means two terminals wired together answer each other forever. And "=c", the tertiary DA, used to be answered with the primary reply, because "=" is not ">" and those were the only two cases; there is no unit ID to give, so it now goes unanswered like every terminal without DECRPTUI. Fixes #51 Co-authored-by: Tom Laird-McConnell <17789481+tomlm@users.noreply.github.com>
|
@claude I have enabled dotnet tool and when you are done, change title to remove [WIP] and remove Draft status |
|
Claude finished @tomlm's task in 4m 37s —— View job Verified — and one comment in the last push was telling the wrong story
Verification
So I verified through CI instead, which is a real run of the real commit rather than a claim:
All seven DA tests pass by name in the second log. Claude Code Review is red on both, for a reason that has nothing to do with the code: The correctionReading the dispatch path with the code in front of me, the claim in my last comment about The identifier that was mishandled is Nothing about the reply strings changed. The substance of the PR still stands:
What I could not doI'm unable to change the title or clear the draft flag: |
The tertiary DA never reached DeviceAttributes: ToCsiCommand strips only "?" and ">" before the lookup, so "=c" resolves to Unknown. The comments claimed it fell through to the primary reply, which was the wrong story about the wrong identifier. The identifier that did go wrong is "?c" -- it sets isPrivate the same as ">c", so it used to be handed the secondary reply. Pinned with a test. Co-authored-by: Tom Laird-McConnell <17789481+tomlm@users.noreply.github.com>
|
@claude I fixed permissions for gh |
|
Claude finished @tomlm's task in 1m 40s —— View job Done — title cleared, draft lifted, and verified locally at last
All seven DA tests pass by name locally ( Two judgment calls worth flaggingI rewrote the PR body. It was still the WIP task checklist with most boxes unticked, which reads oddly on a PR that's now asking for review. It's replaced with a description of what the change does and why those six attributes were dropped; I left the title's wording alone — it's now One thing I noticed but did not touchThe build emits a single warning, pre-existing and unrelated to this PR: That test has no No code changed in this run — the branch is unchanged since --- · branch |
"What is mapped now" left >q out of the list of explicitly mapped private identifiers, while the Summary says everything not listed falls out as Unknown and is ignored. >q is in the map, resolves to SelectCursorStyle, and InputHandler splits it back out to XTVERSION -- so a reader following this document concluded CSI > Ps q is ignored when it is answered, on the one row the table above says this change exists to fix. It is now listed, and called out as the one deliberate shared entry. "the dispatcher no longer needs to re-decide which command it is holding" was true of XTSMGRAPHICS and false as the general claim it read as, since >q re-decides on identifier.PrivateMarker() in this same branch. The sentence now says what the difference is: an isPrivate flag cannot tell '?' from '>', while the marker is the same byte the map matched on. Also stale or missing: - "left the other six" predates main fixing XTVERSION (#63) and the ?c/=c device attributes case (#64) in the dispatcher. Three of the seven had been patched one at a time, which is a better version of the same point. - The table omitted CSI > Pm T (XTRESTTITLE), which this change also stops running as SCROLL DOWN. - The mapped list said nothing about the bare "q" now being absent, which is the intermediate-byte half of the same exactness rule. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015yLt7uosRs4EnvTpR3MSRD
Device attributes now describe this emulator instead of copying xterm's answer.
A DA reply is a promise: every attribute in it names a sequence the program will now go ahead and send. The previous list claimed capabilities this tree doesn't implement, so those sequences went out and nothing happened — the screen the program believed it drew wasn't the screen that was there.
What it reports now
CSI ? 62 ; 22 c, orCSI ? 62 ; 4 ; 22 cwith Sixel enabled. 62 is service class 2 (VT220), the level whose core this code does implement: scrolling regions, insert/delete line and character, erase character, the alternate buffer, DECSC/DECRC.CSI > 1 ; 200 ; 0 c. Terminal type 1 is a VT220, agreeing with the 62 rather than contradicting it the way the old0(VT100) did.Pvis the package version flattened to one number.Attributes
1(DECCOLM),2(printer port),6(DECSCA),9(NRCS),15(technical characters) and21(DECSLRM) were each checked against the tree and dropped, because the code behind them is absent. Two of those had teeth: a program reading21sets left and right margins and draws inside them, and one reading2pushes a print job through a printer-controller mode this emulator never enters, which puts the job on the screen.Two more fixes in the same handler
CSI ? cwas answered with the secondary reply —?sets the same coarseisPrivateflag that>does, so the program got the answer to a question it hadn't asked while still waiting for the one it had. Dispatch is now on the identifier.Seven tests cover the replies, the non-zero parameter, the private marker and the tertiary request. Full suite: 1218/1218.
Fixes #51