When dumping scrollback as ansi, reset SGR formatting at end of scrollback

This commit is contained in:
Kovid Goyal 2019-08-27 19:35:01 +05:30
parent 44599c9460
commit bc222af2e2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -497,8 +497,11 @@ class Window:
sanitizer = text_sanitizer(as_ansi, add_wrap_markers)
h = list(map(sanitizer, h))
self.screen.historybuf.as_text(h.append, as_ansi, add_wrap_markers)
if not self.screen.linebuf.is_continued(0) and h:
h[-1] += '\n'
if h:
if not self.screen.linebuf.is_continued(0):
h[-1] += '\n'
if as_ansi:
h[-1] += '\x1b[m'
lines = chain(h, lines)
return ''.join(lines)