Mail Archives: cygwin/2006/01/30/12:49:32
On Mon, Jan 30, 2006 at 10:50:13AM -0500, Bob Rossi wrote:
> On Mon, Jan 30, 2006 at 07:11:45AM -0700, Eric Blake wrote:
> > According to Bob Rossi on 1/28/2006 9:19 PM:
> > > On Linux, something totally different happens. When I initialize
> > > readline, it eventually calls tgetent, which happens to set LINES and
> > > COLS to the correct size of the terminal. On cygwin this doesn't happen.
> > > The call readline makes to tgetent leaves LINES and COLS alone. Then,
> > > in Cygwin when I get to initscr, LINES and COLS is set to 25x80, unless
> > > I set the LINES and COLUMNS environment variables before the call to
> > > initscr.
> >
> > http://www.die.net/doc/linux/man/man3/tgetent.3.html does not document
> > that tgetent() messes with the environment, but if that is the case, you
> > may be onto something. Perhaps it really is something cygwin1.dll needs
> > to patch to be more similar to linux.
>
> I've finally produced a small test case like you asked me too. It did
> take some time, but it should certainly help discover the problem. I've
> attached the program.
And at last I believe I found the problem, but only after compiling
ncurses with debug.
The function shell.c:sh_set_lines_and_columns in readline sets the
LINES and COLUMNS environment variables. It get's it's data from the
PTY you assign to rl_instream. The LINES and COLUMNS environment
variables effect the way ncurses work. If they are set, ncurses assumes
that the size of the terminal is LINESxCOLUMNS and sets the ncurses
variables LINES and COLS appopriatly.
So, when I give readline a PTY, if the size of the LINES and COLUMNS are
different then that of stdout, then ncurses get's confused.
Chet, do you consider this desired functionality? I don't think readline
should modify the LINES and COLUMNS environment variables if the PTY
it's using is not stdout. What do you think?
Anyways, for know, I can probably try to make the PTY I give readline
the same size as the stdout PTY.
Thanks,
Bob Rossi
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -