Message ID | 83wokxwl3a.fsf@gnu.org |
---|---|
State | New |
Headers | show |
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
Eli> However, your change gave me an idea, and I think I came up with a bit
Eli> better fix, see below (the patch is again the current HEAD). With
Eli> that, the original problem seems to be fixed, and we still don't
Eli> produce redundant lines in the command window. WDYT?
I think as long as it works, it is good. Thanks.
Tom
> From: Tom Tromey <tom@tromey.com> > Cc: Tom Tromey <tom@tromey.com>, palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org > Date: Sun, 17 Mar 2019 11:31:27 -0600 > > >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes: > > Eli> However, your change gave me an idea, and I think I came up with a bit > Eli> better fix, see below (the patch is again the current HEAD). With > Eli> that, the original problem seems to be fixed, and we still don't > Eli> produce redundant lines in the command window. WDYT? > > I think as long as it works, it is good. Thanks. So okay to push to both branches?
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes: >> From: Tom Tromey <tom@tromey.com> >> Cc: Tom Tromey <tom@tromey.com>, palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org >> Date: Sun, 17 Mar 2019 11:31:27 -0600 >> >> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes: >> Eli> However, your change gave me an idea, and I think I came up with a bit Eli> better fix, see below (the patch is again the current HEAD). With Eli> that, the original problem seems to be fixed, and we still don't Eli> produce redundant lines in the command window. WDYT? >> >> I think as long as it works, it is good. Thanks. Eli> So okay to push to both branches? Yes, please. Thanks. Tom
> From: Tom Tromey <tom@tromey.com> > Cc: Tom Tromey <tom@tromey.com>, palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org > Date: Mon, 18 Mar 2019 08:13:30 -0600 > > >> I think as long as it works, it is good. Thanks. > > Eli> So okay to push to both branches? > > Yes, please. Thanks. Thanks, done.
--- gdb/tui/tui-io.c~6 2019-03-17 14:03:10.448181200 +0200 +++ gdb/tui/tui-io.c 2019-03-17 14:03:53.951772800 +0200 @@ -696,12 +696,6 @@ gdb_wgetch (WINDOW *win) nonl (); int r = wgetch (win); nl (); - /* In nonl mode, if the user types Enter, it will not be echoed - properly. This will result in gdb output appearing immediately - after the command. So, if we read \r, emit a \r now, after nl - mode has been re-entered, so that the output looks correct. */ - if (r == '\r') - puts ("\r"); return r; } @@ -928,7 +922,7 @@ tui_getc (FILE *fp) /* The \n must be echoed because it will not be printed by readline. */ - if (ch == '\n') + if (ch == '\n' || ch == '\r') { /* When hitting return with an empty input, gdb executes the last command. If we emit a newline, this fills up the command window