manager: fix clear command broken by log refactor - #1577
Merged
Conversation
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.
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.
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.
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, hex1b5b 481b 5b4a), but ExecuteAPMAction.kt checked"\u001B[H\u001B[2J"(7 bytes, an extra2) withsubstring(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 diffrenders 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\u001Bescapes 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