-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing the escape sequence from the console output! #139
Conversation
The output coming from the console Terminal consists of Bracketed Paste escape sequence! I have updated the code in a way that it will check the status output and see if the output has this sequence, it will remove this from the output and then use only integer o/p of status command! Before applying the patch status output was: ^[[?2004l0 After applying the patch status output is: 0 Signed-off-by: Anushree Mathur <[email protected]>
Debug log for the run: Before applying the patch: (04/13) type_specific.io-github-autotest-libvirt.virsh.create.console: STARTED After applying the patch: (04/13) type_specific.io-github-autotest-libvirt.virsh.create.console: STARTED |
@clebergnu can you please help to review this PR and merge |
aexpect/client.py
Outdated
escape_sequence = r'\x1b\[\?[0-9;]*[hl]' | ||
|
||
# Remove the Bracketed Paste Mode escape sequence using re.sub | ||
clean_status = re.sub(escape_sequence, '', status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be more consistent to rely on aexpect.utils.astring.strip_console_codes
. But apart from that it makes sense to strip extra characters that might be present...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review @ldoktor! I will use this function and try once.
The output coming from the console Terminal consists of Bracketed Paste escape sequence! I have updated the code in a way that it will check the status output and see if the output has this sequence, it will remove this from the output and then use only integer o/p of status command!
Before applying the patch status output was:
^[[?2004l0
After applying the patch status output is:
0
Signed-off-by: Anushree Mathur [email protected]