Skip to content

Add MXP telnet negotiation (option 91)#8

Merged
powerje merged 1 commit into
trunkfrom
mxp-support
Jun 29, 2026
Merged

Add MXP telnet negotiation (option 91)#8
powerje merged 1 commit into
trunkfrom
mxp-support

Conversation

@powerje

@powerje powerje commented Jun 29, 2026

Copy link
Copy Markdown
Member

Adds MXP (MUD eXtension Protocol, telnet option 91) negotiation so the game server can emit clickable <A>/<SEND> links to MUD clients (Mudlet, MUSHclient, etc.).

What changed

  • TelnetConstants.swift: table[91] now announces .will, so announceSupport() sends IAC WILL MXP.
  • CommFlags.swift: new .mxp bit (1 << 8).
  • TelnetSession.swift: handle IAC DO MXP (set the flag, emit ESC[7z Lock-Locked so normal output is never parsed as markup) and IAC DONT MXP (clear it); expose mxpEnabled; add reassertMXP() for copyover restore.

The ESC[7z locked default means tags are only interpreted inside an explicit secure span (ESC[1z … ESC[2z), which the consumer emits per link — so existing output containing stray < > & is shown verbatim.

Tests

Tests/MTHTests/MXPNegotiationTests.swift covers the WILL announcement, DO→enabled+locked-default, DONT→disabled, and idempotency. swift test green.

@powerje
powerje merged commit 2288c71 into trunk Jun 29, 2026
4 of 5 checks passed
@powerje
powerje deleted the mxp-support branch June 29, 2026 09:55
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.

1 participant