From 63c34bf0a019af4507cbd5efe5cb5c3bcb315516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 4 Jan 2022 10:04:15 +0100 Subject: [PATCH] astring: Add bracketed paste console codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the bracketed-paste generates '\x1b[?2004l' and '\x1b[?2004h' console codes that needs to be added to the list of console codes otherwise such output breaks 'strip_console_codes'. Signed-off-by: Lukáš Doktor --- aexpect/utils/astring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aexpect/utils/astring.py b/aexpect/utils/astring.py index e565365..f3e0d39 100644 --- a/aexpect/utils/astring.py +++ b/aexpect/utils/astring.py @@ -36,7 +36,7 @@ def strip_console_codes(output, custom_codes=None): index = 0 output = f"\x1b[m{output}" console_codes = "%[G@8]|\\[[@A-HJ-MPXa-hl-nqrsu\\`]" - console_codes += "|\\[[\\d;]+[HJKgqnrm]|#8|\\([B0UK]|\\)" + console_codes += "|\\[[\\d;]+[HJKgqnrm]|#8|\\([B0UK]|\\)|\\[\\?2004[lh]" if custom_codes is not None and custom_codes not in console_codes: console_codes += f"|{custom_codes}" while index < len(output):