Repository navigation
wolfterm: fix CSI erase modes and SGR on Windows - #1390
Merged
Merged
Conversation
Contributor
Author
|
@claude review |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1390
Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
ejohnstown
force-pushed
the
wolfterm-csi
branch
from
November 11, 2026 23:37
05eca68 to
da69199
Compare
ejohnstown
force-pushed
the
wolfterm-csi
branch
from
November 18, 2026 17:15
da69199 to
126f414
Compare
ejohnstown
force-pushed
the
wolfterm-csi
branch
from
November 30, 2026 18:41
126f414 to
7be91e8
Compare
|
@claude review |
The Windows console translator handles ED and EL modes as ECMA-48 does: an omitted mode is 0, mode 0 erases from the cursor to the end, mode 1 from the start through the cursor cell, and mode 2 the whole display or line. Mode 1J now clears the rows above the cursor too. - ED 0-2 take the display as the whole buffer, the rows CSI H addresses, so no old text is left where the cursor can go - Erased cells take the current attributes, so an old background colour does not survive the erase - wolfSSH_ClearScreen() wraps at the buffer width, not the maximum window width Issue: F-10556, F-12549
doDisplayAttributes() starts from the current console attributes, applies each SGR argument to that value in order, and sets the result once, so ESC[1;31m keeps the bold. SGR 0 resets to the default attributes mid-sequence. - SGR 25 (blink off) is a no-op; there is no blink to turn off - SGR 39 restores the default foreground colour and keeps the bold Issue: F-11663, F-15506
test_wolfSSH_ConvertConsole_csi() runs ED, EL and SGR sequences against an off-screen console buffer and reads back the cells and attributes. It returns early when no console is attached. - ED 0-2 run again with the window scrolled down, with the cursor inside and below it, and with 2J before and after CSI H - Erased cells are checked for the current attributes - SGR 39 is checked with and without bold Issue: F-10556, F-12549, F-11663, F-15506
doDisplayAttributes() takes the 5;N or 2;R;G;B after SGR 38 or 48 as one colour and sets the nearest console colour, rather than reading each sub-parameter as an SGR code of its own. - Indexes 0-15 map directly; the 6x6x6 cube, the grey ramp and RGB go to the nearest of the 16 console colours - An incomplete colour is skipped and leaves the attributes alone - api-test checks indexed, RGB, background and incomplete colours
ejohnstown
force-pushed
the
wolfterm-csi
branch
from
December 2, 2026 18:45
7be91e8 to
cc7d9a4
Compare
philljj
approved these changes
Dec 2, 2026
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.
The Windows console translator handles ED and EL modes 0-2 as ECMA-48
does, erases in the current attributes, and parses every SGR argument
in one sequence, extended colours included.
text is left where the cursor can go
the default foreground
Issue: F-10556, F-11663, F-12549, F-15506