This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [readline-mingw] backspace key and TUI size
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Denis PILAT <denis dot pilat at st dot com>
- Cc: gdb-patches at sources dot redhat dot com, bash-maintainers at gnu dot org
- Date: Wed, 08 Feb 2006 18:28:16 +0200
- Subject: Re: [readline-mingw] backspace key and TUI size
- References: <43E9A5B1.1030001@st.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 08 Feb 2006 09:02:57 +0100
> From: Denis PILAT <denis.pilat@st.com>
> 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.