From e534d5f9a0942157bcdbffae858855ea0a5802f0 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 24 Oct 2012 13:56:45 +0200 Subject: [PATCH] Made sure to kill color at the end of msg:es. This makes telnet/ssh consistent with webclient output. --- src/server/ssh.py | 2 +- src/server/telnet.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/ssh.py b/src/server/ssh.py index ab6f313537..84bbc3cc22 100644 --- a/src/server/ssh.py +++ b/src/server/ssh.py @@ -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): diff --git a/src/server/telnet.py b/src/server/telnet.py index 3c807177da..6c0d418180 100644 --- a/src/server/telnet.py +++ b/src/server/telnet.py @@ -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')))