Made sure to kill color at the end of msg:es. This makes telnet/ssh consistent with webclient output.

This commit is contained in:
Griatch 2012-10-24 13:56:45 +02:00
parent 16d49e61d3
commit e534d5f9a0
2 changed files with 3 additions and 2 deletions

View file

@ -192,7 +192,7 @@ class SshProtocol(Manhole, session.Session):
if raw:
self.lineSend(string)
else:
self.lineSend(ansi.parse_ansi(string, strip_ansi=nomarkup))
self.lineSend(ansi.parse_ansi(string.strip("{r") + "{r", strip_ansi=nomarkup))
class ExtraInfoAuthServer(SSHUserAuthServer):

View file

@ -162,4 +162,5 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
if raw:
self.sendLine(string)
else:
self.sendLine(ansi.parse_ansi(string, strip_ansi=nomarkup, xterm256=ttype.get('256 COLORS')))
# we need to make sure to kill the color at the end in order to match the webclient output.
self.sendLine(ansi.parse_ansi(string.rstrip("{n") + "{n", strip_ansi=nomarkup, xterm256=ttype.get('256 COLORS')))