Created attachment 125775 [details] Screenshot of gap 1 When Konsole draws the cursor, it always shifts down cursor Y position by one pixel. Usually it is not noticeable but in some applications, e.g. Vim, it produces an annoying gap on highlighted background. For example, when you search a text in Vim, it highlights all occurrences of that text in a file. When you place the cursor over the highlighted text, a small but noticeable gap appears. Another example is highlighting of matching parentheses which reveals the same gap. Please check the attached screenshots. The adjustment of cursor position is located in TerminalDisplay::drawCursor: // shift rectangle top down one pixel to leave some space // between top and bottom QRectF cursorRect = rect.adjusted(0, 1, 0, 0); Not sure whether this adjustment is still useful for some purposes or not. Shouldn't we simply remove it? Thanks!
Created attachment 125776 [details] Screenshot of gap 2
Created attachment 125777 [details] Remove adjustment of the cursor rectangle to avoid unwanted gaps
The code you remove says it's intentional.
Indeed, the comment to the code says it is intentional but the result looks buggy. In most other terminal emulators the cursor height is the same as line height without any gaps. I checked further and seems like this code was added while fixing another bug https://bugs.kde.org/show_bug.cgi?id=343283 The last commenter also wonders why the cursor is shifted down by one pixel. Seems like it was just an arbitrary choice without a clear reason. I believe it would be better to remove the gap and draw the cursor just like other terminal emulators do.
(In reply to Christoph Feck from comment #3) > The code you remove says it's intentional. git blame'ing that points to bug 343283 - it doesn't seem to me that this gap of 1 pixel was intentional at all.
Thanks for the report and screenshots Arthur, however I can't seem to reproduce this on konsole from git master. Can you please retest and confirm if this is still an issue, thanks.
Hi Justin, I can still reproduce the issue using the latest git master. It is not very noticeable though. There is just 1-pixel gap after all, so I used to live with it :) Looking at the code, character classes were recently moved to new terminalDisplay directory. Nevertheless, the cursor adjustment code that produces a gap is still there - in TerminalPainter::drawCursor.
Confirmed.