Bug 408660 - Konsole's cursor becomes colorized by colorized print output
Summary: Konsole's cursor becomes colorized by colorized print output
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-13 19:26 UTC by postix
Modified: 2021-03-10 19:12 UTC (History)
2 users (show)

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


Attachments
Screenshot of the issue. (34.46 KB, image/png)
2019-06-13 19:26 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2019-06-13 19:26:14 UTC
Created attachment 120848 [details]
Screenshot of the issue.

SUMMARY

If a command prints its output in a certain color and does not clear this color at the end of the output, the cursor takes this color.

If space bar and then the return key is pressed or another command is executed, the colored cursor becomes gray again.


STEPS TO REPRODUCE
1. Open Konsole
2. enter "echo -e "I \033[0;31mlove \033[0;34mKDE!"


Operating System: Manjaro Linux 
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.3
Kernel Version: 5.1.8-1-MANJARO
Comment 1 Egmont Koblinger 2019-06-15 08:16:29 UTC
This only happens if you've already reached the bottom of the screen.

It's a side effect of the nightmare called "bce" (see e.g. https://bugzilla.gnome.org/show_bug.cgi?id=754596). The entire newly appearing line at the bottom needs to take the _current_ background color according to this badly designed feature. In Konsole it does not only take the background but also the foreground. The cursor is displayed by swapping these two colors of the cell, that is, revealing the foreground color of the empty cell. That's why you see blue cursor instead of gray.

On a side note, in VTE (gnome-terminal and friends) the current foreground is applied to the newly appearing line only if there's also a nondefault background color to apply. This is probably a bug rather than deliberate design choice, although I'm not sure.

Not sure what Konsole could do here. Not spreading the foreground color could be a technically more correct behavior, although potentially lead to less visible cursor in many cases. I think it's more likely that the _current_ foreground is easy to distinguish from the _current_ background, rather than that the *default* foreground is easy to distinguinsh from the _current_ background.
Comment 2 postix 2019-06-15 17:33:19 UTC
Thanks Egmont, that means you can confirm it.