From 7e6adb2fd911b1fe7508a8084e67c6d405d83644 Mon Sep 17 00:00:00 2001 From: BlauFeuer Date: Fri, 3 Mar 2017 18:01:27 -0500 Subject: [PATCH] Escape markup character when it ends a line --- evennia/server/portal/ssh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evennia/server/portal/ssh.py b/evennia/server/portal/ssh.py index 1d70f14cfb..07e6fe64e4 100644 --- a/evennia/server/portal/ssh.py +++ b/evennia/server/portal/ssh.py @@ -283,7 +283,8 @@ 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", strip_ansi=nocolor, xterm256=xterm256, mxp=False) + linetosend = ansi.parse_ansi(_RE_N.sub("", text) + ("|n" if text[-1] != "|" else "||n"), + strip_ansi=nocolor, xterm256=xterm256, mxp=False) self.sendLine(linetosend) def send_prompt(self, *args, **kwargs):