Skip to content

send both SCO and DEC proprietary sequence for terminal compatibility - #5

Merged
morikuni merged 1 commit into
morikuni:masterfrom
ndeloof:sco_dec
Dec 11, 2025
Merged

send both SCO and DEC proprietary sequence for terminal compatibility#5
morikuni merged 1 commit into
morikuni:masterfrom
ndeloof:sco_dec

Conversation

@ndeloof

@ndeloof ndeloof commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

fixes #4

@morikuni

Copy link
Copy Markdown
Owner

Thank you for the PR! The approach of sending both SCO and DEC sequences is correct.

However, there's an issue with the DEC escape sequences:

Current implementation:

Save = newAnsi(esc + "s" + esc + "7")      // ESC[s + ESC[7
Restore = newAnsi(esc + "u" + esc + "8")   // ESC[u + ESC[8

Problem: The DEC sequences should be ESC7 and ESC8, not ESC[7 and ESC[8. The esc constant is "\x1b[" (CSI - Control Sequence Introducer), but DEC sequences don't use CSI.

Correct implementation:

Save = newAnsi(esc + "s" + "\x1b7")       // ESC[s + ESC7
Restore = newAnsi(esc + "u" + "\x1b8")    // ESC[u + ESC8

Reference: https://en.wikipedia.org/wiki/ANSI_escape_code#Fp_Escape_sequences

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof

ndeloof commented Dec 11, 2025

Copy link
Copy Markdown
Contributor Author

my bad, fixed

@morikuni

Copy link
Copy Markdown
Owner

Thank you!

@morikuni
morikuni merged commit b7ec452 into morikuni:master Dec 11, 2025
@morikuni

Copy link
Copy Markdown
Owner

Released https://github.com/morikuni/aec/releases/tag/v1.1.0

@ndeloof
ndeloof deleted the sco_dec branch December 11, 2025 07:17
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.

Show/Restore use SCO codes

2 participants