[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: Allow ctrl-d to act as del-char and re-assign ^D (EOT) to ctr

From: Dr . Jürgen Sauermann
Subject: Re: Patch: Allow ctrl-d to act as del-char and re-assign ^D (EOT) to ctrl-z
Date: Tue, 6 Jul 2021 19:51:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0


thanks a lot. The patch is included in SVN 1477.

Best Regards,

On 7/4/21 10:10 AM, Russtopia wrote:

Please see below a small patch proposal for a new configure option to move the ^D (EOT) behaviour to a different key (^Z which is currently unassigned), which allows keyboard ctrl-D to act as delete-char.

I did this because I found my muscle-memory from bash, emacs etc. caused me to hit CTRL-D too often while editing lines. I find it convenient to have CTRL-D act as expected in concert with CTRL-A,E,K,P,N.

If CTRL-Z is not good, perhaps it could be assigned elsewhere but I didn't see how to easily assign to a less-common key that isn't already in use.



Index: src/LineInput.cc
--- src/LineInput.cc (revision 1458)
+++ src/LineInput.cc (working copy)
@@ -903,10 +903,23 @@
+              case UNI_SUB:
+                   CERR << "^D";
+                   eof = true;
+                   break;
               case UNI_EOT:   // ^D
                    CERR << "^D";
                    eof = true;
+                   lec.delete_char();
+                   continue;
               case UNI_BS:    // ^H (backspace)
@@ -1089,6 +1102,10 @@
              case UNI_SO:  return UNI_CursorDown;    // ^N
              case UNI_DLE: return UNI_CursorUp;      // ^P
              case UNI_EM:  return UNI_EM;      // ^Y
+             case UNI_SUB: return UNI_SUB;     // ^Z (as alt EOT, allowing ^D as delete-char)
              default: goto again;
Index: configure.ac
--- configure.ac (revision 1458)
+++ configure.ac (working copy)
@@ -411,6 +411,20 @@
 AM_CONDITIONAL(WANT_LIBAPL, test "x$user_wants_libapl" = xyes)
+AC_MSG_CHECKING([if user wants ctrl-d to be del-char (moving EOT to ctrl-z)])
+AC_ARG_WITH( [ctrld_del],
+             [AS_HELP_STRING([--with-ctrld_del],
+                             [enable to use ctrl-d as del-char, ctrl-z as EOT])],
+             [user_wants_ctrld_del=yes])
+if test "x$user_wants_ctrld_del" = xyes ; then
+    AC_DEFINE([WANT_CTRLD_DEL], [1], [Define if ctrl-d should act as del-char and ctrl-z should be EOT])
+AM_CONDITIONAL(WANT_CTRLD_DEL, test "x$user_wants_ctrld_del" = xyes)
 # check if the user wants to build the python extension gnu_apl.so
 AC_MSG_CHECKING([if we want to build libpython_apl.so])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]