bug-ncurses
[Top][All Lists]
Advanced

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

Re: Automatic Margins


From: Thomas Dickey
Subject: Re: Automatic Margins
Date: Thu, 2 Apr 2009 19:23:29 -0400 (EDT)

On Thu, 2 Apr 2009, Bryan Christ wrote:

if capability 'am' is assumed to mean

1. x=width
2. addch() & wrap (am)
3. x=0,y=y+1

then does 'bw' mean..

1. x=0
2. cub1 & wrap (bw)
3. x=width, y=y-1

?

the behavior that auto_right_margin moves the cursor y+1 is not
documented and auto_left_margin is also not specific.

man 5 terminfo:

       auto_left_margin              bw         bw        cub1 wraps from col-
                                                          umn 0 to last column
       auto_right_margin             am         am        terminal has auto-
                                                          matic margins
...
       All capabilities have names.  For instance, the fact that ANSI-standard
       terminals  have  automatic margins (i.e., an automatic return and line-
       feed when the end of a line is reached) is indicated by the  capability
       am.   Hence  the description of ansi includes am.  Numeric capabilities
...

       A very important point here is that the local cursor motions encoded in
       terminfo are undefined at the left and top edges  of  a  CRT  terminal.
       Programs should never attempt to backspace around the left edge, unless
       bw is given, and never attempt to go up locally off the top.  In  order
       to  scroll  text up, a program will go to the bottom left corner of the
       screen and send the ind (index) string.
...
       The  am capability tells whether the cursor sticks at the right edge of
       the screen when text is output, but this does not necessarily apply  to
       a  cuf1  from  the last column.  The only local motion which is defined
       from the left edge is if bw is given, then a cub1 from  the  left  edge
       will  move  to the right edge of the previous row.  If bw is not given,
       the effect is undefined.  This is useful for drawing a box  around  the


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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