[stable-2.10] Document existing ansi_re sequences and add ESC[m (#70683) (#70807)

* Document existing ansi_re sequences and add `ESC[m`

* Add changelog
(cherry picked from commit 06a4fc2)

Co-authored-by: Nathaniel Case <ncase@redhat.com>
This commit is contained in:
Nathaniel Case 2020-07-22 21:27:21 -04:00 committed by GitHub
parent 18dd73c147
commit 4cbfb08da5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- Terminal plugins - add "\e[m" to the list of ANSI sequences stripped from device output

View file

@ -48,8 +48,9 @@ class TerminalBase(with_metaclass(ABCMeta, object)):
#: compiled bytes regular expressions to remove ANSI codes #: compiled bytes regular expressions to remove ANSI codes
ansi_re = [ ansi_re = [
re.compile(br'(\x1b\[\?1h\x1b=)'), re.compile(br'\x1b\[\?1h\x1b='), # CSI ? 1 h ESC =
re.compile(br'\x08.') re.compile(br'\x08.'), # [Backspace] .
re.compile(br"\x1b\[m"), # ANSI reset code
] ]
#: terminal initial prompt #: terminal initial prompt