Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Patrick Palka <patrick@parcs.ath.cx>
To: gdb-patches@sourceware.org
Cc: Patrick Palka <patrick@parcs.ath.cx>
Subject: [PATCH] Intercept and handle Delete/Home/End keys in the TUI
Date: Wed, 03 Jun 2015 23:29:00 -0000	[thread overview]
Message-ID: <1433374131-30902-1-git-send-email-patrick@parcs.ath.cx> (raw)

These keys are mapped by wgetch() to special ncurses-specific values and
are otherwise passed through to readline, to no useful effect.

This patch intercepts these keys in the TUI and gives them their
expected function.

gdb/ChangeLog:

	* tui/tui-command.c: Include "readline/readline.h".
	(tui_dispatch_ctrl_char): Handle KEY_DC, KEY_HOME and KEY_END.
---
 gdb/tui/tui-command.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 03ec076..84ba2b7 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -27,6 +27,7 @@
 #include "tui/tui-command.h"
 
 #include "gdb_curses.h"
+#include "readline/readline.h"
 /*****************************************
 ** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
 ******************************************/
@@ -76,6 +77,15 @@ tui_dispatch_ctrl_char (unsigned int ch)
     case KEY_LEFT:
       tui_scroll_right (win_info, 1);
       break;
+    case KEY_DC:
+      rl_delete (1, ch);
+      break;
+    case KEY_HOME:
+      rl_point = 0;
+      break;
+    case KEY_END:
+      rl_point = rl_end;
+      break;
     case '\f':
       break;
     default:
-- 
2.4.2.387.gf86f31a.dirty


             reply	other threads:[~2015-06-03 23:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 23:29 Patrick Palka [this message]
2015-06-03 23:55 ` Patrick Palka
2015-06-10 15:28   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433374131-30902-1-git-send-email-patrick@parcs.ath.cx \
    --to=patrick@parcs.ath.cx \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox