Skip to content

Write ClearScreen in MXP as the terminal's erase - #111

Merged
HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-fixh9h
Nov 16, 2026
Merged

HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-fixh9h

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Requested by Grave · project thread

Fixes #109.

What changes

  • MXP: MarkupText.ClearScreen() now writes ESC[H ESC[2J (with WithAnsi()), where it wrote nothing. MXP output already carries SGR, so the erase is expected in that stream.
  • Pueblo: unchanged, <xch_page clear="text"> alone. The Pueblo client rewrites ESC[2J into 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.
  • No fallback text for clients that drop a clear: the server can't tell which they are, and a blank line would stay on a screen that did clear.
  • docs/formats.md gets a "Clearing the screen" section with a client table, taken from each client's source.

What the clients do (from source)

Client ESC[H ESC[2J <xch_page clear="text">
Pueblo (uecasm/pueblo) clears clears
MUSHclient dropped (Phase_ANSI reads only m/z) dropped (xch_page only calls MXP_Off)
Mudlet dropped (TBuffer.cpp refuses ED) no Pueblo
BeipMU dropped (SGR and OSC 8 only) dropped (attributes skipped)
SharpMUTerm decoded as ClearScreenMarkup, not acted on same
SharpClient decoded, then ignored on purpose (OutputView.razor) same

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.
  • Full suite on net11.0: 1791 passed. Solution build has no warnings.

Generated by Claude Code

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
@HarryCordewener HarryCordewener self-assigned this Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@HarryCordewener
HarryCordewener marked this pull request as ready for review November 16, 2026 05:31
@HarryCordewener
HarryCordewener merged commit 763684c into main Nov 16, 2026
7 checks passed
@HarryCordewener
HarryCordewener deleted the claude/project-thread-fixh9h branch November 16, 2026 05:32
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.

Make MarkupText.ClearScreen() clear the screen in MXP and Pueblo clients

2 participants