From owner-svn-src-head@FreeBSD.ORG Sun Sep 5 16:12:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C31F10656D0; Sun, 5 Sep 2010 16:12:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E535A8FC16; Sun, 5 Sep 2010 16:12:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o85GCAsO088454; Sun, 5 Sep 2010 16:12:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o85GCAgn088451; Sun, 5 Sep 2010 16:12:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201009051612.o85GCAgn088451@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Sep 2010 16:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212235 - head/lib/libedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 16:12:11 -0000 Author: jilles Date: Sun Sep 5 16:12:10 2010 New Revision: 212235 URL: http://svn.freebsd.org/changeset/base/212235 Log: libedit: Try to map to ed-delete-next-char. This adds a new "arrow" key "delete" corresponding to the kD termcap value. It only works if that is a sequence such as "\033[3~"; if it is "\177", the em-delete-prev-char or ed-delete-prev-char from the single-character mappings remains. It turns out that most terminals (xterm and alikes, syscons in xterm mode) produce "\033[3~" by default so has the expected effect. This also means that things need to be considerably misconfigured for to perform a action. Modified: head/lib/libedit/term.c head/lib/libedit/term.h Modified: head/lib/libedit/term.c ============================================================================== --- head/lib/libedit/term.c Sun Sep 5 14:52:27 2010 (r212234) +++ head/lib/libedit/term.c Sun Sep 5 16:12:10 2010 (r212235) @@ -223,7 +223,9 @@ private const struct termcapstr { { "kh", "send cursor home" }, #define T_at7 37 { "@7", "send cursor end" }, -#define T_str 38 +#define T_kD 38 + { "kD", "send cursor delete" }, +#define T_str 39 { NULL, NULL } }; @@ -1062,6 +1064,11 @@ term_init_arrow(EditLine *el) arrow[A_K_EN].key = T_at7; arrow[A_K_EN].fun.cmd = ED_MOVE_TO_END; arrow[A_K_EN].type = XK_CMD; + + arrow[A_K_DE].name = "delete"; + arrow[A_K_DE].key = T_kD; + arrow[A_K_DE].fun.cmd = ED_DELETE_NEXT_CHAR; + arrow[A_K_DE].type = XK_CMD; } Modified: head/lib/libedit/term.h ============================================================================== --- head/lib/libedit/term.h Sun Sep 5 14:52:27 2010 (r212234) +++ head/lib/libedit/term.h Sun Sep 5 16:12:10 2010 (r212235) @@ -79,7 +79,8 @@ typedef struct { #define A_K_RT 3 #define A_K_HO 4 #define A_K_EN 5 -#define A_K_NKEYS 6 +#define A_K_DE 6 +#define A_K_NKEYS 7 protected void term_move_to_line(EditLine *, int); protected void term_move_to_char(EditLine *, int);