This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [readline-mingw] backspace key and TUI size


On Fri, Feb 24, 2006 at 10:34:51AM +0200, Eli Zaretskii wrote:
> > First, GDB disables paging because tgetnum ("li") fails, so it assumes
> > we're in a non-console environment.
> 
> You will see that the DJGPP port ifdef's around that code in utils.c.
> 
> > Next, readline sets cols to 79 instead of 80 because we don't have
> > both automatic margins ("am") and ignored newlines beyond the automatic
> > margins ("xn").  This causes utils.c to start printing the prompt
> > at the last column of the previous line instead of the first column
> > of the next line.
> 
> This part I don't understand: it doesn't happen with DJGPP, AFAICS,
> but I don't see any ifdefs in the code to explain the difference.  Can
> you post a short test case that exhibits this problem, and show the
> code that causes utils.c to print the prompt at the wrong place?

This happens because you bypass rl_get_screen_size.  Therefore you
use the "real" screen size, rather than readline's adjusted view of it.
Therefore you print the prompt when you've filled column 80, instead
of column 79.  The relevant bit of code in readline is:

  if (_rl_term_autowrap == 0)
    _rl_screenwidth--;

and:

  _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");

Readline decreases the screen width by one every time you cal
rl_set_screen_size, and supplies the decremented value back for
rl_get_screen_size; GDB relies on (A) having automatic margins,
and (B) having the full screen size.

I guess there are some ways I could get around this...

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]