From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11327 invoked by alias); 24 Feb 2006 14:01:51 -0000 Received: (qmail 11310 invoked by uid 22791); 24 Feb 2006 14:01:50 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 24 Feb 2006 14:01:48 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FCdVx-0006Kl-Pm; Fri, 24 Feb 2006 09:01:45 -0500 Date: Fri, 24 Feb 2006 18:44:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: Denis PILAT , Andrew STUBBS , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org Subject: Re: [readline-mingw] backspace key and TUI size Message-ID: <20060224140144.GA24232@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , Denis PILAT , Andrew STUBBS , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org References: <20060208165114.GA28698@nevyn.them.org> <43EA2A39.4000107@st.com> <20060208173951.GA31572@nevyn.them.org> <43EB0CF9.1080406@st.com> <20060209134942.GA23253@nevyn.them.org> <43ECB429.6070003@st.com> <20060220153647.GA16058@nevyn.them.org> <20060223182145.GA25411@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00462.txt.bz2 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