Merge branch 'master' into develop
This commit is contained in:
commit
e413b1606a
2 changed files with 22 additions and 16 deletions
|
|
@ -246,12 +246,10 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
# escape IAC in line mode, and correctly add \r\n (the TELNET end-of-line)
|
# escape IAC in line mode, and correctly add \r\n (the TELNET end-of-line)
|
||||||
line = line.replace(IAC, IAC + IAC)
|
line = line.replace(IAC, IAC + IAC)
|
||||||
line = line.replace('\n', '\r\n')
|
line = line.replace('\n', '\r\n')
|
||||||
if not self.protocol_flags.get("NOGOAHEAD", True):
|
if not line.endswith("\r\n") and self.protocol_flags.get("FORCEDENDLINE", True):
|
||||||
if self.protocol_flags.get("FORCEDENDLINE", False):
|
|
||||||
line += "\r\n"
|
|
||||||
line += IAC + GA
|
|
||||||
elif not line.endswith("\r\n"):
|
|
||||||
line += "\r\n"
|
line += "\r\n"
|
||||||
|
if not self.protocol_flags.get("NOGOAHEAD", True):
|
||||||
|
line += IAC + GA
|
||||||
return self.transport.write(mccp_compress(self, line))
|
return self.transport.write(mccp_compress(self, line))
|
||||||
|
|
||||||
# Session hooks
|
# Session hooks
|
||||||
|
|
|
||||||
|
|
@ -113,20 +113,28 @@ class Ttype(object):
|
||||||
# only support after a certain version, but all support
|
# only support after a certain version, but all support
|
||||||
# it since at least 4 years. We assume recent client here for now.
|
# it since at least 4 years. We assume recent client here for now.
|
||||||
cupper = clientname.upper()
|
cupper = clientname.upper()
|
||||||
|
xterm256 = False
|
||||||
if cupper.startswith("MUDLET"):
|
if cupper.startswith("MUDLET"):
|
||||||
# supports xterm256 stably since 1.1 (2010?)
|
# supports xterm256 stably since 1.1 (2010?)
|
||||||
xterm256 = cupper.split("MUDLET", 1)[1].strip() >= "1.1"
|
xterm256 = cupper.split("MUDLET", 1)[1].strip() >= "1.1"
|
||||||
else:
|
|
||||||
xterm256 = (cupper.startswith("XTERM") or
|
if cupper.startswith("TINYFUGUE"):
|
||||||
cupper.endswith("-256COLOR") or
|
# tinyfugue expects _GA + endline
|
||||||
cupper in ("ATLANTIS", # > 0.9.9.0 (aug 2009)
|
self.protocol.protocol_flags["FORCEDENDLINE"] = True
|
||||||
"CMUD", # > 3.04 (mar 2009)
|
|
||||||
"KILDCLIENT", # > 2.2.0 (sep 2005)
|
if (cupper.startswith("XTERM") or
|
||||||
"MUDLET", # > beta 15 (sep 2009)
|
cupper.endswith("-256COLOR") or
|
||||||
"MUSHCLIENT", # > 4.02 (apr 2007)
|
cupper in ("ATLANTIS", # > 0.9.9.0 (aug 2009)
|
||||||
"PUTTY", # > 0.58 (apr 2005)
|
"CMUD", # > 3.04 (mar 2009)
|
||||||
"BEIP", # > 2.00.206 (late 2009) (BeipMu)
|
"KILDCLIENT", # > 2.2.0 (sep 2005)
|
||||||
"POTATO")) # > 2.00 (maybe earlier)
|
"MUDLET", # > beta 15 (sep 2009)
|
||||||
|
"MUSHCLIENT", # > 4.02 (apr 2007)
|
||||||
|
"PUTTY", # > 0.58 (apr 2005)
|
||||||
|
"BEIP", # > 2.00.206 (late 2009) (BeipMu)
|
||||||
|
"POTATO", # > 2.00 (maybe earlier)
|
||||||
|
"TINYFUGUE" # > 4.x (maybe earlier)
|
||||||
|
)):
|
||||||
|
xterm256 = True
|
||||||
|
|
||||||
# all clients supporting TTYPE at all seem to support ANSI
|
# all clients supporting TTYPE at all seem to support ANSI
|
||||||
self.protocol.protocol_flags['ANSI'] = True
|
self.protocol.protocol_flags['ANSI'] = True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue