Skip to content

Reach G2 and G3, and implement the national replacement sets - #135

Closed
tomlm wants to merge 1 commit into
fix/unanswered-queriesfrom
fix/charset-shifts
Closed

tomlm wants to merge 1 commit into
fix/unanswered-queriesfrom
fix/charset-shifts

Conversation

@tomlm

@tomlm tomlm commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Fixes #131 and #132 — two halves of the same gap: a character set the emulator could be told about and then had no way to use. Stacked on #134.

Single and locking shifts (#131)

G2 and G3 could be designated and never invoked, so whatever a program put in them printed as ASCII. HandleEsc gained N, O, n, o:

before after
G0 via ESC ( 0 ▒▒▒ ▒▒▒
G1 via ESC ) 0 + SO ▒▒▒ ▒▒▒
G2 via LS2 aaa ▒▒▒
G2 via SS2 aXX ▒XX
G3 via LS3 aaa ▒▒▒
G3 via SS3 aXX ▒XX

SO and SI were already this operation for G1 and G0; the locking shifts join them. The single shifts are held pending rather than swapped in, so they expire by being consumed rather than by something remembering to put the old set back — and a shift with no character after it simply never fires. The run-printing fast path is skipped while one is pending, since it prints without translating.

National replacement sets (#132)

Nine of them — French, German, Swedish, Italian, Spanish, Norwegian/Danish, Dutch, Swiss, Finnish — each remapping a handful of ASCII positions, gated on DECNRCM as the standard requires.

French, NRC off          #@[
French, NRC on           £à°
designated, then NRC on  £à°

Designations are now remembered by ID, not only as the table they resolved to. That third line is why: a national set means one thing with DECNRCM set and ASCII without it, so a program that designates French and then enables NRC mode expects French — and it never designates again. Changing the mode re-resolves what is already designated.

The primary DA has advertised feature 9 all along, which is what tipped this toward implementing the sets rather than dropping the claim: they were promised.

Verification

2133 passed, 3 skipped, 0 failed. The two skipped tests from #127 for these issues are unskipped here and pass; the probe that originally found both was re-run and is the table above.

Still skipped after this: #123 (DA3, deliberately contested), #124 (DECREQTPARM), #130 (S8C1T).

🤖 Generated with Claude Code

https://claude.ai/code/session_015XLGxUGrQiUnsqz3yneHsy

Two halves of the same gap: a character set the emulator could be told
about and then had no way to use.

SS2, SS3, LS2 and LS3 (#131). G2 and G3 could be designated and never
invoked, so whatever a program put in them printed as ASCII. SO and SI
were already the same operation for G1 and G0; the locking shifts join
them. The single shifts are held PENDING rather than swapped in, so they
expire by being consumed instead of by something remembering to put the
old set back, and a shift with no character after it simply never fires.
The run-printing fast path is skipped while one is pending, since it
prints without translating.

The national replacement sets (#132). Nine of them -- French, German,
Swedish, Italian, Spanish, Norwegian/Danish, Dutch, Swiss, Finnish --
each remapping a handful of ASCII positions, gated on DECNRCM as the
standard requires.

Designations are now remembered BY ID, not only as the table they
resolved to. A national set means one thing with DECNRCM set and ASCII
without it, so a program that designates French and then enables NRC mode
expects French -- and it never designates again. Changing the mode
re-resolves what is already designated.

The DA has advertised feature 9 all along, which is what made this worth
implementing rather than removing from the DA: the sets were promised.

Verified: G0, G1, LS2 and LS3 all reach the graphics set; SS2 and SS3
shift exactly one character; French reads #@[ with NRC off and the pound,
a-grave and degree with it on, in either order of designation and mode.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XLGxUGrQiUnsqz3yneHsy
@tomlm tomlm mentioned this pull request Aug 31, 2026
@tomlm

tomlm commented Aug 31, 2026

Copy link
Copy Markdown
Owner Author

Folded into #141, VTTEST alignment — one PR instead of a stack. Same commits, same content.

@tomlm tomlm closed this Aug 31, 2026
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.

1 participant