Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit set some readline compatibility default key sett...
details: https://anonhg.NetBSD.org/src/rev/9c07e7734017
branches: trunk
changeset: 336873:9c07e7734017
user: christos <christos%NetBSD.org@localhost>
date: Tue Mar 24 21:29:52 2015 +0000
description:
set some readline compatibility default key settings.
https://bugzilla.redhat.com/attachment.cgi?id=1001895
diffstat:
lib/libedit/readline.c | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diffs (56 lines):
diff -r 1369b6177660 -r 9c07e7734017 lib/libedit/readline.c
--- a/lib/libedit/readline.c Tue Mar 24 21:26:50 2015 +0000
+++ b/lib/libedit/readline.c Tue Mar 24 21:29:52 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $ */
+/* $NetBSD: readline.c,v 1.114 2015/03/24 21:29:52 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $");
+__RCSID("$NetBSD: readline.c,v 1.114 2015/03/24 21:29:52 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -362,6 +362,37 @@
_el_rl_tstp);
el_set(e, EL_BIND, "^Z", "rl_tstp", NULL);
+ /*
+ * Set some readline compatible key-bindings.
+ */
+ el_set(e, EL_BIND, "^R", "em-inc-search-prev", NULL);
+
+ /*
+ * Allow the use of Home/End keys.
+ */
+ el_set(e, EL_BIND, "\\e[1~", "ed-move-to-beg", NULL);
+ el_set(e, EL_BIND, "\\e[4~", "ed-move-to-end", NULL);
+ el_set(e, EL_BIND, "\\e[7~", "ed-move-to-beg", NULL);
+ el_set(e, EL_BIND, "\\e[8~", "ed-move-to-end", NULL);
+ el_set(e, EL_BIND, "\\e[H", "ed-move-to-beg", NULL);
+ el_set(e, EL_BIND, "\\e[F", "ed-move-to-end", NULL);
+
+ /*
+ * Allow the use of the Delete/Insert keys.
+ */
+ el_set(e, EL_BIND, "\\e[3~", "ed-delete-next-char", NULL);
+ el_set(e, EL_BIND, "\\e[2~", "ed-quoted-insert", NULL);
+
+ /*
+ * Ctrl-left-arrow and Ctrl-right-arrow for word moving.
+ */
+ el_set(e, EL_BIND, "\\e[1;5C", "em-next-word", NULL);
+ el_set(e, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL);
+ el_set(e, EL_BIND, "\\e[5C", "em-next-word", NULL);
+ el_set(e, EL_BIND, "\\e[5D", "ed-prev-word", NULL);
+ el_set(e, EL_BIND, "\\e\\e[C", "em-next-word", NULL);
+ el_set(e, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL);
+
/* read settings from configuration file */
el_source(e, NULL);
Home |
Main Index |
Thread Index |
Old Index