diff --git a/tbot/machine/channel/channel.py b/tbot/machine/channel/channel.py index f313e32d..d49c539f 100644 --- a/tbot/machine/channel/channel.py +++ b/tbot/machine/channel/channel.py @@ -914,9 +914,10 @@ def read_until_prompt( buf += new if isinstance(self.prompt, bytes): - if buf.endswith(self.prompt): + index = buf.find(self.prompt) + if index > -1: return ( - buf[: -len(self.prompt)] + buf[:index] .decode("utf-8", errors="replace") .replace("\r\n", "\n") .replace("\n\r", "\n")