Repository navigation
Write ClearScreen in MXP as the terminal's erase - #111
Merged
Merged
Conversation
MXP has no clear of its own and was sent nothing. Its clients already read SGR in the same stream, so it now gets ESC[H ESC[2J. Pueblo keeps <xch_page clear="text"> alone. docs/formats.md gains a table of which clients clear, from their source. Fixes #109 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rqqt7W4pTuJocxqXvvDUcf
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.
Requested by Grave · project thread
Fixes #109.
What changes
MarkupText.ClearScreen()now writesESC[H ESC[2J(withWithAnsi()), where it wrote nothing. MXP output already carries SGR, so the erase is expected in that stream.<xch_page clear="text">alone. The Pueblo client rewritesESC[2Jinto that same tag, and the other Pueblo readers act on neither, so adding the erase would clear nothing more and would decode as two clears.docs/formats.mdgets a "Clearing the screen" section with a client table, taken from each client's source.What the clients do (from source)
ESC[H ESC[2J<xch_page clear="text">Phase_ANSIreads onlym/z)xch_pageonly callsMXP_Off)TBuffer.cpprefuses ED)ClearScreenMarkup, not acted onOutputView.razor)So in the clients SharpMUSH players use, a clear still won't wipe the screen. For SharpMUSH #2778, the engine shouldn't count on a clear having happened before it resends the connect screen.
Tests
SharedVocabularyTests.ClearingTheScreenIsEachFormatsOwnInstruction: MXP now expects\e[H\e[2J.MxpDecodingTests.ClearScreen_AsAServerWritesIt_IsOneClear: MXP output with secure lines decodes to exactly one clear.Generated by Claude Code