From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28072 invoked by alias); 8 Feb 2006 08:03:48 -0000 Received: (qmail 28059 invoked by uid 22791); 8 Feb 2006 08:03:45 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-01.spheriq.net (HELO fra-del-01.spheriq.net) (195.46.51.97) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Feb 2006 08:03:40 +0000 Received: from fra-out-01.spheriq.net (fra-out-01.spheriq.net [195.46.51.129]) by fra-del-01.spheriq.net with ESMTP id k1883b2X027104 for ; Wed, 8 Feb 2006 08:03:37 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-01.spheriq.net with ESMTP id k18835AW010473 for ; Wed, 8 Feb 2006 08:03:30 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id k18834Gw023059 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 8 Feb 2006 08:03:05 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 12BF5DA4E; Wed, 8 Feb 2006 08:03:00 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A6FAD4722D; Wed, 8 Feb 2006 08:06:36 +0000 (GMT) Received: from st.com (crx1177.cro.st.com [164.129.47.77]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CGQ33804 (AUTH "denis pilat"); Wed, 8 Feb 2006 09:02:57 +0100 (CET) Message-ID: <43E9A5B1.1030001@st.com> Date: Wed, 08 Feb 2006 08:03:00 -0000 From: Denis PILAT User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Cc: bash-maintainers@gnu.org Subject: [readline-mingw] backspace key and TUI size Content-Type: multipart/mixed; boundary="------------080704020901060504050507" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.2.01 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/msg00167.txt.bz2 This is a multi-part message in MIME format. --------------080704020901060504050507 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 618 Hi, When compiling gdb 6.4 for native window host (minGW) I get a gdb.exe and a gdbtui.exe where there were 2 problems. - In the gdbtui.exe version, the TUI interface do not fit in the DOS command window. - In the gdb.exe version, the backspace key do not behave correctly. I did some little modification in readline to fix both problems. I attach the patch applied. I've already submitted it to Chet Ramey (the readline maintainer at bash-maintainers@gnu.org) who accepted it. I don't know the gdb policy with readline synchronization, but I would like it to be integrated as well in gdb distribution. Denis --------------080704020901060504050507 Content-Type: text/plain; name="20060206-mingw-readline-tuisize-backspace.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="20060206-mingw-readline-tuisize-backspace.patch" Content-length: 1408 Index: readline/terminal.c =================================================================== --- readline/terminal.c (revision 328) +++ readline/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,15 @@ 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); + CONSOLE_SCREEN_BUFFER_INFO scr; + 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) { @@ -299,6 +313,7 @@ void rl_resize_terminal () { +printf("rl_resize_terminal\n"); if (readline_echoing_p) { _rl_get_screen_size (fileno (rl_instream), 1); @@ -593,8 +608,8 @@ { register int i; -#ifndef __MSDOS__ - if (_rl_term_backspace) +#if !defined (__MSDOS__) && !defined (__MINGW32__) + if (_rl_term_backspace) for (i = 0; i < count; i++) tputs (_rl_term_backspace, 1, _rl_output_character_function); else --------------080704020901060504050507--