Fix one ANSI formatting escape code not being removed from the pager history buffer when piping it as plain text

Fixes #3132
This commit is contained in:
Kovid Goyal 2020-12-01 13:17:35 +05:30
parent f481c17732
commit 457c292d3c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -35,6 +35,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- macOS: Partial fix for traditional fullscreen not working on Big Sur
(:iss:`3100`)
- Fix one ANSI formatting escape code not being removed from the pager history
buffer when piping it as plain text (:iss:`3132`)
0.19.2 [2020-11-13]
-------------------

View File

@ -241,7 +241,7 @@ def text_sanitizer(as_ansi: bool, add_wrap_markers: bool) -> Callable[[str], str
pat = getattr(text_sanitizer, 'pat', None)
if pat is None:
import re
pat = re.compile(r'\033\[.+?m')
pat = re.compile('\033\\[.*?m')
setattr(text_sanitizer, 'pat', pat)
ansi, wrap_markers = not as_ansi, not add_wrap_markers