Bug 340031 - vim cursorline not cleared properly
Summary: vim cursorline not cleared properly
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.14.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-16 19:13 UTC by Arkadiusz Miskiewicz
Modified: 2018-04-02 20:14 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arkadiusz Miskiewicz 2014-10-16 19:13:46 UTC
When running "vim /etc/passwd", enabling cursorline mode (:set cursorline) in vim and moving cursor up and down "cursor line" is not drawn properly. When going up it is drawn multiple times, in each line and previous line is not being cleared.

Reproducible: Always

Steps to Reproduce:
Just like in "Details" above.
1. set white/black color scheme for kde konsole
2. vim /etc/passwd
3. :set cursorline
4. move cursor up and down.

Actual Results:  
This video shows the problem:
http://ixion.pld-linux.org/~arekm/kde-4.14.2-konsole-bug.avi

Expected Results:  
"cursor line" should be only one, drawn where cursor is

Now someone could say this is vim bug but:
- it doesn't happen with xterm
- it doesn't happen with linux konsole (no X)
- it does happen on kde konsole (tested with TERM=xterm, TERM=konsole, TERM=konsole-256color)
- it does happen if I ssh to remote host from kde konsole and run vim there
- tested locally and remotely with PLD/Linux but also remotely with Centos 5 - reproduced in all cases
- konsole color scheme needs to be with black background (using white/black)
- I can reproduce this also using yakuake, so more confidence in konsole being the problem (konsole part)
Comment 1 Jonathan Doman 2014-10-23 16:06:57 UTC
I've been seeing this for a long time (seems like years), but it seemed very intermittent. I finally tried to fix it, and came to the same conclusion that it's an issue with Konsole.
Comment 2 Boris Egorov 2014-11-01 03:20:20 UTC
Interesting. It clears redundant cursor lines after switching to another app/desktop.
Comment 3 Arkadiusz Miskiewicz 2014-11-01 19:13:22 UTC
Reproduced with irssi, too
(konsole (4.14.2) + irssi (0.8.17))

https://www.youtube.com/watch?v=DWl7Kf9H2rU&feature=youtu.be
Comment 4 Arkadiusz Miskiewicz 2014-11-13 19:37:01 UTC
A better way to reproduce:

- set Liberation Mono as konsole font - this is important as problem doesn't happen with every font (it doesn't happen with Terminus for example)
- xrandr --dpi 80 (just change DPI to non default value; sometimes this step is not needed)
- run new konsole copy
- vim /etc/passwd with cursorline turned on, move up and down
Comment 5 Daniel Lichtenberger 2015-01-04 20:41:03 UTC
I also noticed this issue first in vim, but I can reproduce it directly in konsole by enabling underlines in the following shell command:

tput sgr 0 1 0  0 0 0  0 0 0

Then press enter a couple of times. With any font except Liberation Mono, the underlines are rendered correctly. With Liberation Mono (which happens to be the default monospace font on OpenSuse) and font sizes up to 13pt, only the next-to-last prompt is underlined, and there are display artifacts (underlines not removed) when pressing Ctrl-L.

You can disable underlines again with tput sgr 0 0 0  0 0 0  0 0 0.

Triggering a refresh (e.g. by switching to another tab and then back again) causes the underlines to be rendered correctly.

Judging from the visual impression of konsole's rendering, it seems like the newlines are put "too far down" - they are almost overlapping with the next line, which doesn't happen for me with other fonts.

I'm running Konsole 2.14.2 under KDE 4.14.3, Qt 4.8.6 (OpenSuse 13.2).
Comment 6 Ricardo J. Barberis 2017-02-10 04:16:26 UTC
On Konsole 16.12.1, vim's cursorline seems to work correctly.

But tput only underlines the single next line after pressing Enter, every subsequent line is not undelined.

There's also a lot of artifacts: search some string with Ctrl+R and then cancel or press ESC or Enter and the few last characters show duplicated.

Maybe both are related?
Comment 7 Ahmad Samir 2018-02-11 15:36:25 UTC
Closing per c#6, the vim issue seems fixed; also I can't reproduce this with a recent master git build.

If you can still reproduce this bug, feel free to reopen the report.
Comment 8 Ricardo J. Barberis 2018-04-02 19:56:45 UTC
(In reply to Ricardo J. Barberis from comment #6)
> There's also a lot of artifacts: search some string with Ctrl+R and then
> cancel or press ESC or Enter and the few last characters show duplicated.
> 
> Maybe both are related?

I just discovered this is caused because I have TERM=xterm-256color in konsole, if I do export TERM=xterm I don't get this behavior.

I haven't been able to find where does TERM get set to change it permanently.

Also, on yakuake built on KDE SC 4.x, TERM=xterm and it works correctly.
Comment 9 Ricardo J. Barberis 2018-04-02 20:14:40 UTC
(In reply to Ricardo J. Barberis from comment #8)
> (In reply to Ricardo J. Barberis from comment #6)
> > There's also a lot of artifacts: search some string with Ctrl+R and then
> > cancel or press ESC or Enter and the few last characters show duplicated.
> > 
> > Maybe both are related?
> 
> I just discovered this is caused because I have TERM=xterm-256color in
> konsole, if I do export TERM=xterm I don't get this behavior.
> 
> I haven't been able to find where does TERM get set to change it permanently.
> 
> Also, on yakuake built on KDE SC 4.x, TERM=xterm and it works correctly.

Found it, posting for future reference as this makes CTRL+L and CTRL+R work again for me in konsole:

Open konsole -> Settings -> Manage Profiles -> Edit profile -> Environment: Edit