Skip to content

Commit

Permalink
utils/astring: add expected control characters
Browse files Browse the repository at this point in the history
Fixes: avocado-framework#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 <[email protected]>
  • Loading branch information
smitterl committed Aug 7, 2024
1 parent 33fd20e commit e4f4a86
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions aexpect/utils/astring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

1 comment on commit e4f4a86

@clebergnu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @smitterl ,

I also don't know what these codes are. You probably already know this, but even though this may fix an issue you've found, it doesn't feel quite right to merge this without knowing what they are.

I'll try to find what they are, and if I do, I'll let you know.

Please sign in to comment.