Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [readline-mingw] backspace key and TUI size
@ 2006-02-08  8:03 Denis PILAT
  2006-02-08 13:43 ` Daniel Jacobowitz
  2006-02-08 16:28 ` Eli Zaretskii
  0 siblings, 2 replies; 28+ messages in thread
From: Denis PILAT @ 2006-02-08  8:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: bash-maintainers

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

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

[-- Attachment #2: 20060206-mingw-readline-tuisize-backspace.patch --]
[-- Type: text/plain, Size: 1408 bytes --]

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 <windows.h>
+#  include <wincon.h>
+#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

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2006-02-25 11:28 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08  8:03 [readline-mingw] backspace key and TUI size Denis PILAT
2006-02-08 13:43 ` Daniel Jacobowitz
2006-02-08 16:03   ` Denis PILAT
2006-02-08 16:05     ` Bob Rossi
2006-02-08 16:14     ` Daniel Jacobowitz
2006-02-08 16:30       ` Chet Ramey
2006-02-08 16:48       ` Andrew STUBBS
2006-02-08 16:51         ` Daniel Jacobowitz
2006-02-08 17:04           ` Chet Ramey
2006-02-08 17:13             ` Daniel Jacobowitz
2006-02-08 17:54               ` Eli Zaretskii
2006-02-08 17:09           ` Eli Zaretskii
2006-02-08 17:30             ` Andrew STUBBS
2006-02-08 17:40               ` Daniel Jacobowitz
2006-02-09  9:36                 ` Denis PILAT
2006-02-09 13:49                   ` Daniel Jacobowitz
2006-02-10 15:41                     ` Denis PILAT
2006-02-10 18:52                       ` Eli Zaretskii
2006-02-20 15:36                       ` Daniel Jacobowitz
2006-02-23 18:25                         ` Daniel Jacobowitz
2006-02-24  8:36                           ` Eli Zaretskii
2006-02-24 18:44                             ` Daniel Jacobowitz
2006-02-24 18:48                               ` Eli Zaretskii
2006-02-24 19:29                                 ` Daniel Jacobowitz
2006-02-25 11:35                                   ` Eli Zaretskii
2006-02-08 17:56       ` Eli Zaretskii
2006-02-08 18:03         ` Daniel Jacobowitz
2006-02-08 16:28 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox