You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(telnet): stop Mudlet masking all input for the whole session (#633)
* fix(telnet): stop Mudlet masking all input for the whole session
Mudlet (and other local-echo clients) treat telnet WILL ECHO as a
"mask this field" hint rather than a server-echo request. GoMud asserted
WILL ECHO unconditionally at connect and never withdrew it, so Mudlet
masked every keystroke for the entire session.
Detect the client type at connect via an MNES NEW-ENVIRON probe and
branch the echo behavior:
- Mudlet: baseline WONT ECHO (Mudlet echoes locally); the server no
longer echoes/masks per character or emits its own newline. Password
prompts are masked by transiently asserting WILL ECHO and withdrawing
it (WONT ECHO) once the step validates.
- Raw telnet: unchanged - WILL ECHO baseline with server-side echo and
mask-character passwords.
- Web client: unchanged - TEXTMASK toggling, no server-side per-char echo.
Detection is synchronous and bounded (200ms per read, 2s overall); a
client that ignores NEW-ENVIRON falls back to non-Mudlet and still logs
in. AI connections skip the probe and keep the historical baseline.
Changes:
- connections.ClientSettings: add IsMudlet / DetectionComplete.
- ConnectionDetails.SetReadDeadline for the bounded probe reads.
- term: NEW-ENVIRON sub-negotiation codes, request/response matchers,
and a TelnetRequestMNESVars helper.
- TelnetIACHandler: negotiate NEW-ENVIRON and record IsMudlet from
CLIENT_NAME, plus a unit test for the response parser.
- main.go: detectClientType probe and echo-baseline branch.
- login_prompt_handler: skip server echo/mask and newline for local-echo
clients; toggle ECHO masking around Mudlet password steps.
* term: alias NEW-ENVIRON codes to existing telnet constants
Address review feedback on PR #633: the NEW-ENVIRON sub-negotiation
codes share byte values with telnet option constants already defined in
this block, so alias them instead of re-declaring literals. Values are
unchanged (IS/VAR=0, SEND/VALUE=1, INFO/ESC=2, USERVAR=3), so behavior
is identical.
* telnet: offer EOR and broaden NEW-ENVIRON detection for Mudlet masking
Real-Mudlet testing showed password masking half-working: Mudlet honored
WILL ECHO (command echo suppressed) but did not put asterisks on the
input line. Aligns the connect/detection sequence with a known-working
downstream fork:
- Offer WILL EOR at connect. Mudlet prefers EOR over GA to delimit
prompts; with SUPPRESS-GO-AHEAD set and no EOR, Mudlet has no prompt
anchor for its input-line masking.
- Request ALL NEW-ENVIRON variables (empty SEND) instead of naming
specific ones - broadly compatible; Mudlet returns CLIENT_NAME among
them.
- Match the NEW-ENVIRON IS response on the 'IAC SB NEW-ENVIRON IS'
prefix alone (tolerant of TCP segmentation / trailing bytes), and make
the parser treat IAC as a name/value terminator so a trailing IAC SE
never bleeds into the final variable's value.
0 commit comments