Bug 434187 - background color is not reset properly if ANSI reset code is on newline
Summary: background color is not reset properly if ANSI reset code is on newline
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-09 14:15 UTC by paul
Modified: 2021-03-09 14:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of colored command output. (14.87 KB, image/png)
2021-03-09 14:15 UTC, paul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description paul 2021-03-09 14:15:17 UTC
Created attachment 136525 [details]
Screenshot of colored command output.

SUMMARY

When setting the background color via an ANSI SGR escape sequence such as '\e[41m', and the reset sequence '\e[0m' is placed on a new line, the bg-color is not reset immediately.

STEPS TO REPRODUCE

printf '\e[0mLine1\n\e[41mLine2\n\e[0mLine3\nLine4\n'

OBSERVED RESULT

see screenshot.
The word "Line2" has a colored background as expected, but the empty end of "Line3" is colored as well.

(If the reset comes after multiple newlines, only the first '\n' seems to respect the bg color, subsequent lines color the whole window width.)


EXPECTED RESULT
Only "Line2" should have a red background, same as in

printf '\e[0mLine1\n\e[41mLine2\e[0m\nLine3\nLine4\n'

On other terminal emulators such as xterm or QTerminal, there is no difference between those two commands.

SOFTWARE/OS VERSIONS
Arch-Linux, Kernel 5.11.2
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2