PATCH: PR tui/9622: tui over-eagerly initializes readline

H.J. Lu
2010-02-04T17:07:06Z

We shouldn't initialize readline if gdb_stdout isn't a tty. OK
to install?

Thanks.

H.J.
---
2010-02-04 H.J. Lu <hongjiu.lu@intel.com>

PR tui/9622
* tui/tui-interp.c (tui_init): Call tui_initialize_readline
only if gdb_stdout is a tty.

diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 3b59769..3bb8246 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -57,7 +57,8 @@ tui_init (int top_level)

tui_initialize_io ();
tui_initialize_win ();
- tui_initialize_readline ();
+ if (ui_file_isatty (gdb_stdout))
+ tui_initialize_readline ();

return NULL;
}