summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorNathaniel Case <this.is@nathanielca.se>2020-10-06 17:03:52 -0400
committerGitHub <noreply@github.com>2020-10-06 21:03:52 +0000
commit419295a74f2c2162c75046e15bba51e1db220960 (patch)
tree6ca16e15ba22c6dec68e8db50a76b69f2e325594 /plugins
parentbc5ca2c243ed916b0f90050966cc074a783ce79b (diff)
downloadvyos.vyos-419295a74f2c2162c75046e15bba51e1db220960.tar.gz
vyos.vyos-419295a74f2c2162c75046e15bba51e1db220960.zip
Update terminal ansi_re (#87)
Update terminal ansi_re Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'plugins')
-rw-r--r--plugins/terminal/vyos.py15
1 files changed, 11 insertions, 4 deletions
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 <title string> BEL)
+ re.compile(br"\x1b]0;[^\x07]*\x07"),
]
try: