From 154799f6e074a19e864d5c66ba27fc26c977924b Mon Sep 17 00:00:00 2001 From: BlauFeuer Date: Mon, 17 Apr 2017 04:22:56 -0400 Subject: [PATCH] Fix to color normalization end tag in ssh. Initial fix in #1243 does not account for empty string. Addresses a potential problem similar to IndexError in telnet.py #1306 --- evennia/server/portal/ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/server/portal/ssh.py b/evennia/server/portal/ssh.py index 07e6fe64e..d06114e60 100644 --- a/evennia/server/portal/ssh.py +++ b/evennia/server/portal/ssh.py @@ -283,7 +283,7 @@ class SshProtocol(Manhole, session.Session): else: # we need to make sure to kill the color at the end in order # to match the webclient output. - linetosend = ansi.parse_ansi(_RE_N.sub("", text) + ("|n" if text[-1] != "|" else "||n"), + linetosend = ansi.parse_ansi(_RE_N.sub("", text) + ("||n" if text.endswith("|") else "|n"), strip_ansi=nocolor, xterm256=xterm256, mxp=False) self.sendLine(linetosend)