I've been playing with Python's readline
module. One of the things I noticed is the lack of support to directly bind a key to a Python function. In other words, there is no binding for readline's rl_bind_key()
.
My intention is to have different completion logics depending on the key pressed. For example, apart from the traditional tab completion, I would like to bind something like C-<space>
and perform completion using a different function. Or, another example, to imitate Cisco shell and bind the ?
key to a command listing with a description.
With only one completer bound, is it possible to retrieve the key that triggered the completion event?
Thanks.