From 419295a74f2c2162c75046e15bba51e1db220960 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Tue, 6 Oct 2020 17:03:52 -0400 Subject: Update terminal ansi_re (#87) Update terminal ansi_re Reviewed-by: https://github.com/apps/ansible-zuul --- plugins/terminal/vyos.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/terminal/vyos.py b/plugins/terminal/vyos.py index 6f5fc76..a659002 100644 --- a/plugins/terminal/vyos.py +++ b/plugins/terminal/vyos.py @@ -40,10 +40,17 @@ class TerminalModule(TerminalBase): re.compile(br"\n\s+Set failed"), ] - ansi_re = [ - re.compile(br"\x1b\[\?1h\x1b="), # CSI ? 1 h ESC = - re.compile(br"\x08."), # [Backspace] . - re.compile(br"\x1b\[m"), # ANSI reset code + ansi_re = TerminalBase.ansi_re + [ + # Color codes + re.compile(br"\x1b\[(\d+(;\d+)*)?m"), + # Clear line (CSI K) + re.compile(br"\x1b\[K"), + # Xterm change cursor mode (CSI ? 1 [h|l]) + re.compile(br"\x1b\[\?1(h|l)"), + # Xterm change keypad (ESC [=|>]) + re.compile(br"\x1b(=|>)"), + # Xterm window title string (OSC BEL) + re.compile(br"\x1b]0;[^\x07]*\x07"), ] try: -- cgit v1.2.3