diff options
-rw-r--r-- | debug/testlib.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py index 1f023f0..bbca9fe 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -692,7 +692,8 @@ class Gdb: self.active_child.sendline(command) self.active_child.expect("\n", timeout=timeout) self.active_child.expect(r"\(gdb\)", timeout=timeout) - return self.active_child.before.strip().decode("utf-8", errors="ignore") + ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') + return ansi_escape.sub('', self.active_child.before.strip().decode("utf-8", errors="ignore")).strip() def interact(self): """Call this from a test at a point where you just want to interact with |