[Top][All Lists]

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

Readline macro definition with multibyte characters

From: Grisha Levit
Subject: Readline macro definition with multibyte characters
Date: Sat, 4 Feb 2017 21:07:29 -0500

The character-search command accepts multibyte characters just fine, but when reading input from a macro, multibyte characters are not processed correctly. For example trying to invoke the macro defined with:

bind '"\C-f": "\C-]π"'

will fail to search and will instead type just the second byte of the character (x80).

The following one-line patch fixes the behavior, but I'm not sure if this the right place to do it.

--- a/lib/readline/input.c
+++ b/lib/readline/input.c
@@ -457,7 +457,7 @@ rl_read_key ()
       /* If input is coming from a macro, then use that. */
       if (c = _rl_next_macro_key ())
-       return (c);
+       return ((unsigned char) c);
       /* If the user has an event function, then call it periodically. */
       if (rl_event_hook)

reply via email to

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