Skip to content

Commit 26fae6c

Browse files
committed
fix(console): use substring match for prompt detection
endswith() fails when the received data contains extra characters after the prompt (e.g. trailing spaces or CR). Use 'in' to match the prompt anywhere in the received line. Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
1 parent 1c7c11f commit 26fae6c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mtda/console/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _matchprompt(self):
106106
return False
107107
if prompt.startswith("\r"):
108108
prompt = prompt[1:]
109-
return prompt.endswith(self._prompt)
109+
return self._prompt in prompt
110110

111111
def prompt(self, newPrompt=None):
112112
with self.rx_lock:

0 commit comments

Comments
 (0)