]> git.ipfire.org Git - thirdparty/systemd.git/commit
ptyfwd: tweaks to background tinting logic
authorLennart Poettering <lennart@poettering.net>
Wed, 31 Jan 2024 17:48:53 +0000 (18:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 9 Feb 2024 17:27:01 +0000 (18:27 +0100)
commitd0aa368c85adf2efa29c363a6671927fe7e8e76f
treeb70d61b438e25c6fabf99c4f2600a80a59c31c6c
parente90ec3a847b0685e35534c00156f481ef1506432
ptyfwd: tweaks to background tinting logic

This makes two changes:

1. it resets the background color not only on NL (aka LF) but also on
   CR, but without erasing things to the end of the line. This increases
   compatbility with tools such as "less" which use CR to jump back to
   the beginning of the line.

2. previously we'd not process series of newlines or ansi sequences
   without intermediate other characters correctly, we'd always assume
   what follows is regular text. Fix that, and correctly determine the
   right state from the subsequent character.
src/shared/ptyfwd.c