From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13896 invoked by alias); 8 Feb 2006 16:28:39 -0000 Received: (qmail 13884 invoked by uid 22791); 8 Feb 2006 16:28:39 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Feb 2006 16:28:38 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HUX03575; Wed, 8 Feb 2006 18:28:19 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-80-230-155-31.inter.net.il [80.230.155.31]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CQS80204 (AUTH halo1); Wed, 8 Feb 2006 18:28:16 +0200 (IST) Date: Wed, 08 Feb 2006 16:28:00 -0000 Message-Id: From: Eli Zaretskii To: Denis PILAT CC: gdb-patches@sources.redhat.com, bash-maintainers@gnu.org In-reply-to: <43E9A5B1.1030001@st.com> (message from Denis PILAT on Wed, 08 Feb 2006 09:02:57 +0100) Subject: Re: [readline-mingw] backspace key and TUI size Reply-to: Eli Zaretskii References: <43E9A5B1.1030001@st.com> 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/msg00173.txt.bz2 > Date: Wed, 08 Feb 2006 09:02:57 +0100 > From: Denis PILAT > Cc: bash-maintainers@gnu.org > > - In the gdb.exe version, the backspace key do not behave correctly. Like Daniel, I don't see this problem on my system. > +/* 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 Shouldn't you make sure the handle returned by GetStdHandle is not INVALID_HANDLE_VALUE, before you use it in a system call? > -#ifndef __MSDOS__ > - if (_rl_term_backspace) > +#if !defined (__MSDOS__) && !defined (__MINGW32__) > + if (_rl_term_backspace) The idea is okay with me, but there;s a stray blank after the last line above. Please remove it. And thanks for working on this.