bug-bash
[Top][All Lists]
Advanced

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

[PATCH] rl_insert: do not optimize macro def input


From: Grisha Levit
Subject: [PATCH] rl_insert: do not optimize macro def input
Date: Wed, 8 Oct 2025 12:37:29 -0400

Avoid dropping from keyboard macro definition keys after the first
from runs of typeahead keys bound to self-insert:

    $ INPUTRC=/ bash --norc -in 2>/dev/null <<< \
        $'\cX(AAA\cX) \exprint-last-kbd-macro'
    A
---
 lib/readline/text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/readline/text.c b/lib/readline/text.c
index 9b00a6f1..72baf331 100644
--- a/lib/readline/text.c
+++ b/lib/readline/text.c
@@ -994,7 +994,7 @@ rl_insert (int count, int c)
   n = (unsigned short)-2;
   while (_rl_optimize_typeahead &&
         rl_num_chars_to_read == 0 &&
-        (RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) &&
+        (RL_ISSTATE 
(RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT|RL_STATE_MACRODEF) == 0) &&
         _rl_pushed_input_available () == 0 &&
         _rl_input_queued (0) &&
         (n = rl_read_key ()) > 0 &&
-- 
2.51.0




reply via email to

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