bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wclrtoeol not clearing entire line?


From: Thomas Dickey
Subject: Re: wclrtoeol not clearing entire line?
Date: Sat, 13 Aug 2016 12:38:43 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 11, 2016 at 10:07:41AM -0400, Bob Rossi wrote:
> Hi,
> 
> I use ncurses for cgdb development. Thanks for all your hard work.
> 
> cgdb displays a gdb window. Previously, I had the gdb prompt always at
> the bottom line. Therefor the cursor was always on the bottom line. 
> 
> I'm changing cgdb to have the gdb prompt start at the top line.
> The prompt moves down as necessary, just like using gdb at a terminal.
> This means the cursor is now moving between lines, top down, instead of
> always on the last line.
> 
> This leads me to the problem I've run into.
> 
> When I clear a line with wclrtoeol, it does not seem to clear the
> old cursor on that line. Is this a known issue? Is there a work around?
> I'll keep this picture here temporarily,
>   http://brasko.net:81/cgdb_cursor_not_cleared.png
> See the extra cursor characters that were not cleared by wclrtoeol.

Actually, I see a fragment of a cursor just after the "n" on this line
near the bottom:

        (gdb) n

If you look closely, that's "between" the "i" and "n" on the preceding line
which begins "Breakpoint".  I think that's someone else's bug (whether
"Terminal" or the X server isn't clear.

> 
> A few things I've tried.
> - Calling werase before I draw the window: old cursor persists
> - Calling wclear before I draw the window: old cursor gone, solved
> - Overwriting the old cursor location with a space: old cursor persists
> - Overwriting the old cursor with an 'x': old cursor gone, but don't want x :)

well... ncurses expects that the terminal displays what it asks it to.
When the terminal malfunctions, it can't do much about that.

If I were troubleshooting it, I'd use "script" to capture a "typescript"
file, and replay that on a comparable terminal (same height/width, same
general type).  Also I'd look closely at the escape sequences to see if
there's something odd about those -- but the "fragment" issue makes me
suspect there's nothing to see there.
 
> I'm pretty naive about how ncurses works, but I've read about the
> virtual screen that it keeps internally. My thoughts are that it is not
> aware that the cursor location has moved, and doesn't understand it
> needs to clean up the old cursor location.

As I see it, the Terminal is painting the cursor with a wider image than
a single-character, and not cleaning up as it moves.  That's actually
complicated to do right - which is why cursors are drawn in a character
cell.

If the font weren't monospaced, then you'd see problems like this - but
more obvious.  Occasionally someone points out a font where the developers
didn't get the metrics (height, width, pitch) right, and the font draws
outside its bounding box.  That also would show up (usually more than this).
 
> I don't really want to call wclear, as I'm guessing that's heavy handed.
> 
> Any suggestions on how to resolve this issue?

I'd try to factor out whether it's the terminal or the X server, and
send a bug report to the corresponding developer...

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]