bug-ncurses
[Top][All Lists]
Advanced

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

Re: the cursor is misplaced after writing the very last column


From: Thomas Dickey
Subject: Re: the cursor is misplaced after writing the very last column
Date: Wed, 24 Aug 2016 20:31:02 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Aug 24, 2016 at 09:31:35PM +0200, Benno Schulenberg wrote:
> 
> Hello Thomas,
> 
> When something is written to the very last column of the last line
> of a window, and one then tries to place the cursor somewhere near
> that last column, the cursor actually appears one column further.
> See the small program below for a demonstration.
> 
> I see this on a Gnome Terminal and on an Xfce-terminal.  It works
> fine on a Linux console.  It works fine on an Xterm too, but *not*
> when the width is artificially reduced with, say, 'stty cols 35'.
> 
> Any idea who or what is at fault here?

pebcak

ncurses assumes you have given the correct screensize.

Some of the optimizations it uses assume that it can rely
upon the right margin for determining when autowrap takes
place.  For VTE and xterm, that would be forward-wrapping.
PuTTY can also wrap back (left). You can see how the screen width
is used by looking for "screen_columns" in lib_mvcur.c

https://github.com/ThomasDickey/ncurses-snapshots/blob/master/ncurses/tty/lib_mvcur.c

This topic has come up occasionally, usually with people setting the
LINES and/or COLUMNS environment variables, and (noticing a problem)
deciding to report a bug.  Not an FAQ, but enough of a nuisance to
make me improve the documentation...

As for the differences between VTE and xterm - I don't recall if
VTE's problems with line-wrapping were in the list of things that
Egmont was working on.  It would take a lot of work to dig that out
of VTE's checkin comments... 
 
-- 
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]