From be6a0f69dab935fecd222dace12ef1ba44b69933 Mon Sep 17 00:00:00 2001 From: mik2k2 <44849223+mik2k2@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:55:10 +0100 Subject: [PATCH] apparently, we have another prefix --- host_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/host_test.go b/host_test.go index 51ff8f4..1a1041e 100644 --- a/host_test.go +++ b/host_test.go @@ -29,6 +29,9 @@ func stripPrompt(s string) string { if endPos := strings.Index(s, "] "); endPos > 0 { return s[endPos+2:] } + if strings.HasPrefix(s, "-> ") { + return s[3:] + } return s } @@ -49,6 +52,10 @@ func TestStripPrompt(t *testing.T) { Input: "[foo] \x1b[6D\x1b[K-> From your friendly system.\r", Want: "From your friendly system.\r", }, + { + Input: "-> Err: must be op.\r", + Want: "Err: must be op.\r", + }, } for i, tc := range tests {