From f8b6d372de120e9a0d8428e36cafbcdd4dffc00a 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` reset screen `!p` soft reset terminal `]104` - execute OS command '104' These control characters are listed in the xterm control sequence cheat sheet at https://gist.github.com/justinmk/a5102f9a0c1810437885a04a07ef0a91 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):