From e4f4a866721e722968092923c103cf8679dbce42 Mon Sep 17 00:00:00 2001 From: Sebastian Mitterle Date: Wed, 7 Aug 2024 10:34:34 -0400 Subject: [PATCH] utils/astring: add expected control characters Fixes: #133 In recent kernel boots, stripping raised error because of missing control characters. Add them: `c` is clear/reset screen `!p` - don't know `]104` - don't know Signed-off-by: Sebastian Mitterle --- aexpect/utils/astring.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aexpect/utils/astring.py b/aexpect/utils/astring.py index 4e58313..ee0329a 100644 --- a/aexpect/utils/astring.py +++ b/aexpect/utils/astring.py @@ -37,6 +37,7 @@ def strip_console_codes(output, custom_codes=None): output = f"\x1b[m{output}" console_codes = "%[G@8]|\\[[@A-HJ-MPXa-hl-nqrsu\\`]" console_codes += "|\\[[\\d;]+[HJKgqnrm]|#8|\\([B0UK]|\\)|\\[\\?2004[lh]" + console_codes += "|[c]|[!p]|[\\]104]" if custom_codes is not None and custom_codes not in console_codes: console_codes += f"|{custom_codes}" while index < len(output):