This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: building gdb with TUI support on Windows
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Hannes Domani <ssbssa at yahoo dot de>
- Cc: gdb at sourceware dot org
- Date: Thu, 01 Jan 2015 17:46:56 +0200
- Subject: Re: building gdb with TUI support on Windows
- Authentication-results: sourceware.org; auth=none
- References: <CAHOBVAcxtD5iXtunUbuHDnv-Wv5HCPRGWKzPb+4E-31KTAE0Nw at mail dot gmail dot com> <1158788672 dot 3333170 dot 1420122368468 dot JavaMail dot yahoo at jws11107 dot mail dot ir2 dot yahoo dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Thu, 1 Jan 2015 14:26:08 +0000 (UTC)
> From: Hannes Domani <ssbssa@yahoo.de>
>
> Ofir Cohen <ofircohenn@gmail.com> schrieb am 22:12 Mittwoch, 31.Dezember 2014:
> > In DOS, "Ctrl + Arrow-Left" skips an entire word (like Alt+B/F on bash).
> > The key sequence of: Esc + b, or Esc + f, seems to accomplish that in gdb.
> >
> > Do you have any idea how to make Ctrl+Left/Right to behave like Esc+b/f?
> >
> > Do I need to intercept these control codes / keys in curses?
>
> Add this to gdb:
>
> --- a/readline/readline.c 2015-01-01 14:47:03.999708300 +0100
> +++ b/readline/readline.c 2015-01-01 14:47:11.399718700 +0100
> @@ -1163,6 +1163,9 @@
> rl_bind_keyseq_if_unbound ("\340O", rl_end_of_line);
> rl_bind_keyseq_if_unbound ("\340S", rl_delete);
> rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode);
> +
> + rl_bind_keyseq_if_unbound ("\340s", rl_backward_word); /* ctrl-left */
> + rl_bind_keyseq_if_unbound ("\340t", rl_forward_word); /* ctrl-right */
> #endif
>
> _rl_keymap = xkeymap;
>
>
>
> And this to pdcurses:
>
> --- a/pdcurses/getch.c 2015-01-01 14:56:25.870495000 +0100
> +++ b/pdcurses/getch.c 2015-01-01 14:56:33.250505300 +0100
> @@ -272,6 +272,12 @@
> case KEY_IC:
> backhalf = 'R';
> break;
> + case CTL_LEFT:
> + backhalf = 's';
> + break;
> + case CTL_RIGHT:
> + backhalf = 't';
> + break;
> }
> if (backhalf)
> {
And the following magic in my ~/.inputrc does the same (and a bit
more) without any source-level changes:
set convert-meta off
"\340\163": backward-word # Ctrl-left
"\340\164": forward-word # Ctrl-right
"\340\223": kill-word # Ctrl-Delete
"\340\165": kill-line # Ctrl-End