bug-readline
[Top][All Lists]
Advanced

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

[Bug-readline] rl_dispatch_callback matches wrong key sequence while one


From: freehaha
Subject: [Bug-readline] rl_dispatch_callback matches wrong key sequence while one is prefix of another one
Date: Tue, 4 Aug 2009 19:33:55 +0800

infos:
tested rl version: 5.2, 6
OS: Ubuntu Hardy, Debian Sid

key sequence matching in callback functions fails when a 2-letters-shorter key seq is defined
the attached "rltest.c" demostrates it.

I think it's a bug in rl_dispatch_callback and hacked it (only one line though).
the patch is attached, hope that it helps. It's a great library :)

--------------
another things which i consider a bug is that while user hava an .inputrc setting editing mode to vi,
readline automatically sets the working keymap to vi_insertion_keymap in the initialization sequence.
 here's the backtracking:

#0  rl_vi_insertion_mode (count=1, key=105) at vi_mode.c:664
#1  0x08049671 in rl_vi_start_inserting (key=105, repeat=1, sign=1) at vi_mode.c:167
#2  0x08049699 in rl_vi_insert_mode (count=1, key=105) at vi_mode.c:672
#3  0x08049233 in readline_internal_setup () at readline.c:395
#4  0x08059cdd in _rl_callback_newline () at callback.c:89
#5  0x08059fe4 in rl_callback_handler_install (prompt=0x80cae1f "", linefunc=0x80481f0 <parse>) at callback.c:102
#6  0x0804837c in main () at rltest.c:57

with a little difference between version 5.x and 6, they both eventually change the working keymap
which is called after the startup hook has been called. so the only way my program ensures using custom
keymap is to set the pre_input_hook. Is this an appropriate behavior of readline ?

English is not my native language, but I'd be willing to help if any further information is needed.

--
Cheers,
freehaha.

Attachment: rltest.c
Description: Text Data

Attachment: readline-callback.patch
Description: Text Data


reply via email to

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