Mudlet likes GA's for prompts

Don't sent GA on every message (not everything is a prompt)
Do enforce line endings for mudlet, it wont display anything without it.
This commit is contained in:
Ben Longden 2021-04-21 18:17:19 +01:00
parent e1b4e1ae68
commit 359842d554
2 changed files with 3 additions and 4 deletions

View file

@ -337,8 +337,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
line = line.replace(b"\n", b"\r\n")
if not line.endswith(b"\r\n") and self.protocol_flags.get("FORCEDENDLINE", True):
line += b"\r\n"
if not self.protocol_flags.get("NOGOAHEAD", True):
line += IAC + GA
return self.transport.write(mccp_compress(self, line))
# Session hooks
@ -440,7 +438,8 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
prompt = mxp_parse(prompt)
prompt = to_bytes(prompt, self)
prompt = prompt.replace(IAC, IAC + IAC).replace(b"\n", b"\r\n")
prompt += IAC + GA
if not self.protocol_flags.get("NOGOAHEAD", True):
prompt += IAC + GA
self.transport.write(mccp_compress(self, prompt))
else:
if echo is not None:

View file

@ -119,7 +119,7 @@ class Ttype(object):
if clientname.startswith("MUDLET"):
# supports xterm256 stably since 1.1 (2010?)
xterm256 = clientname.split("MUDLET", 1)[1].strip() >= "1.1"
self.protocol.protocol_flags["FORCEDENDLINE"] = False
self.protocol.protocol_flags["FORCEDENDLINE"] = True
if clientname.startswith("TINTIN++"):
self.protocol.protocol_flags["FORCEDENDLINE"] = True