From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29488 invoked by alias); 20 Feb 2006 15:36:54 -0000 Received: (qmail 29475 invoked by uid 22791); 20 Feb 2006 15:36:53 -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; Mon, 20 Feb 2006 15:36:52 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FBD5j-0004Da-RY; Mon, 20 Feb 2006 10:36:47 -0500 Date: Mon, 20 Feb 2006 15:36:00 -0000 From: Daniel Jacobowitz To: Denis PILAT Cc: Andrew STUBBS , Eli Zaretskii , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org Subject: Re: [readline-mingw] backspace key and TUI size Message-ID: <20060220153647.GA16058@nevyn.them.org> Mail-Followup-To: Denis PILAT , Andrew STUBBS , Eli Zaretskii , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org References: <43EA1655.609@st.com> <20060208161452.GA26965@nevyn.them.org> <43EA201B.5080305@st.com> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43ECB429.6070003@st.com> 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/msg00358.txt.bz2 On Fri, Feb 10, 2006 at 04:41:29PM +0100, Denis PILAT wrote: > > > Daniel Jacobowitz wrote > > >>Regarding the TUI size, the approach seems to be fine, can I send you a > >>new patch whith a ChangeLog for that ? > >> > >> > > > >Yes, please. > > > > > > > Attached is the new proposal with only TUI stuffs. Just to close the loop on this patch: This was fine with Eli and it's fine with me. Chet, if you've picked this up for readline, please let me know and I'll merge it to GDB's copy. Thanks Denis! > 2005-02-10 Denis Pilat > > * readline/terminal.c > (_rl_get_screen_size): we get console size from windows API > when compiling with minGW. FYI, the standard way to write this changelog entry would be: 2005-02-10 Denis Pilat * readline/terminal.c (_rl_get_screen_size): Get console size from the Windows API when compiling with MinGW. > Index: terminal.c > =================================================================== > --- terminal.c (revision 264) > +++ terminal.c (working copy) > @@ -70,6 +70,11 @@ > #include "rlshell.h" > #include "xmalloc.h" > > +#if defined (__MINGW32__) > +# include > +# include > +#endif > + > #define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay) > #define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc) > > @@ -201,6 +206,20 @@ > struct winsize window_size; > #endif /* TIOCGWINSZ */ > > +/* For mingw version, we get console size from windows API*/ > +#if defined (__MINGW32__) > + HANDLE hConOut = GetStdHandle(STD_OUTPUT_HANDLE); > + if ( hConOut != INVALID_HANDLE_VALUE ) > + { > + CONSOLE_SCREEN_BUFFER_INFO scr; > + if ( GetConsoleScreenBufferInfo(hConOut, &scr) ) > + { > + _rl_screenwidth = scr.dwSize.X; > + _rl_screenheight = scr.srWindow.Bottom - scr.srWindow.Top + 1; > + } > + } > +#endif > + > #if defined (TIOCGWINSZ) > if (ioctl (tty, TIOCGWINSZ, &window_size) == 0) > { -- Daniel Jacobowitz CodeSourcery