Converted encoding setting to use protocol_flags rather than being stored on-session. Also renamed the 256 COLORS TTYPE setting to XTERM256 which is more accurate (and doesn't have a space)

This commit is contained in:
Griatch 2016-03-25 13:01:21 +01:00
parent 1ddfbca7ea
commit 11ecdef7c8
8 changed files with 39 additions and 29 deletions

View file

@ -304,7 +304,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
# handle arguments
options = kwargs.get("options", {})
flags = self.protocol_flags
xterm256 = options.get("xterm256", flags.get('256 COLORS', False) if flags["TTYPE"] else True)
xterm256 = options.get("xterm256", flags.get('XTERM256', False) if flags["TTYPE"] else True)
useansi = options.get("ansi", flags.get('ANSI', False) if flags["TTYPE"] else True)
raw = options.get("raw", False)
nomarkup = options.get("nomarkup", not (xterm256 or useansi))