X-Spam-Check-By: sourceware.org Date: Mon, 30 Jan 2006 12:50:00 -0500 From: Bob Rossi To: cygwin AT cygwin DOT com, Chet Ramey Subject: Re: readline-5.1 && CGDB Message-ID: <20060130175000.GA17071@brasko.net> Mail-Followup-To: cygwin AT cygwin DOT com, Chet Ramey References: <20060127220812 DOT GA6931 AT brasko DOT net> <43DAA063 DOT 7070305 AT byu DOT net> <20060129041953 DOT GB30565 AT brasko DOT net> <43DE1EA1 DOT 9090506 AT byu DOT net> <20060130155013 DOT GA13751 AT brasko DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060130155013.GA13751@brasko.net> User-Agent: Mutt/1.5.9i X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/