Skip to content

manager: fix clear command broken by log refactor - #1577

Merged
Admirepowered merged 1 commit into
bmax121:mainfrom
Prslc:fix_clear_command
Aug 29, 2026
Merged

manager: fix clear command broken by log refactor#1577
Admirepowered merged 1 commit into
bmax121:mainfrom
Prslc:fix_clear_command

Conversation

@Prslc

@Prslc Prslc commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

23e473a rewrote the install log handling and in doing so broke the clear command: the ANSI sequence checked no longer matches what apm actually emits. apm sends ESC [ H ESC [ J (6 bytes, hex 1b5b 481b 5b4a), but ExecuteAPMAction.kt checked "\u001B[H\u001B[2J" (7 bytes, an extra 2) with substring(9), and Install.kt checked "[H[J" with the ESC bytes missing entirely (substring(5)). Neither prefix ever matches, so the escape bytes were appended to the log text and the screen never cleared.

The refactor changed the checked sequence in both screens while apm's output stayed the same, so the two sides no longer matched. The divergence was hard to spot in review because ESC has no glyph: git diff renders the old check as an empty string, and editors and copy-paste can drop the byte silently.

Restored "\u001B[H\u001B[J" + substring(6) at all three call sites (ExecuteAPMAction stdout; Install stdout/stderr), written as visible \u001B escapes that compile to the identical 0x1b byte but stay diffable and paste-safe. Verified on device: installing a module whose script emits the clear sequence clears the log display correctly, and the escape bytes no longer leak into the log text.

References

23e473a broke the clear command: ExecuteAPMAction.kt checked
"\u001B[H\u001B[2J" (7 chars) while apm emits "\u001B[H\u001B[J" (6
chars), and Install.kt checked "[H[J" with the ESC bytes missing —
neither matched, so the escape bytes leaked into the log text.

Restore "\u001B[H\u001B[J" with substring(6) at all three call
sites, written as visible \u001B escapes so diffs cannot corrupt it
again.
@Admirepowered
Admirepowered merged commit 5add26f into bmax121:main Aug 29, 2026
1 check passed
@Prslc
Prslc deleted the fix_clear_command branch August 29, 2026 18:00
SHuiTU68 pushed a commit to SHuiTU68/APatch that referenced this pull request Aug 29, 2026
23e473a broke the clear command: ExecuteAPMAction.kt checked
"\u001B[H\u001B[2J" (7 chars) while apm emits "\u001B[H\u001B[J" (6
chars), and Install.kt checked "[H[J" with the ESC bytes missing —
neither matched, so the escape bytes leaked into the log text.

Restore "\u001B[H\u001B[J" with substring(6) at all three call
sites, written as visible \u001B escapes so diffs cannot corrupt it
again.
SHuiTU68 pushed a commit to SHuiTU68/APatch that referenced this pull request Aug 29, 2026
23e473a broke the clear command: ExecuteAPMAction.kt checked
"\u001B[H\u001B[2J" (7 chars) while apm emits "\u001B[H\u001B[J" (6
chars), and Install.kt checked "[H[J" with the ESC bytes missing —
neither matched, so the escape bytes leaked into the log text.

Restore "\u001B[H\u001B[J" with substring(6) at all three call
sites, written as visible \u001B escapes so diffs cannot corrupt it
again.
SHuiTU68 pushed a commit to SHuiTU68/APatch that referenced this pull request Aug 29, 2026
23e473a broke the clear command: ExecuteAPMAction.kt checked
"\u001B[H\u001B[2J" (7 chars) while apm emits "\u001B[H\u001B[J" (6
chars), and Install.kt checked "[H[J" with the ESC bytes missing —
neither matched, so the escape bytes leaked into the log text.

Restore "\u001B[H\u001B[J" with substring(6) at all three call
sites, written as visible \u001B escapes so diffs cannot corrupt it
again.
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.

2 participants