From f57de43d73dcfe9b62a49330c7b64f94a0f5f4f1 Mon Sep 17 00:00:00 2001 From: Ken Piper Date: Sat, 13 Dec 2014 18:08:40 -0500 Subject: [PATCH] Allow escaping for messages beginning with / --- client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client.go b/client.go index e6749de..639b5e4 100644 --- a/client.go +++ b/client.go @@ -164,6 +164,14 @@ func (c *Client) handleShell(channel ssh.Channel) { parts := strings.SplitN(line, " ", 3) isCmd := strings.HasPrefix(parts[0], "/") + // Allow for messages starting with / that aren't commands to be escaped + if len(line) > 2 { + if line[:3] == "/ /" { + line = line[2:] + isCmd = false + } + } + if isCmd { // TODO: Factor this out. switch parts[0] {