You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have VI insert mode bindings for <M-...> where by <M-> I don't mean traditional 8bit meta but escape prefixed sequence. E.g., <M-h> would be ^]h that is Escape + h.
Now that works ok, but it seems to me prompt_toolkit doesn't have a notion of timeout for when there are multiple bindings for so far ambiguous input, i.e., with above in place I can't go to command mode just by pressing Escape. And even if there is no conflicting binding, there is delay (actually as I've figured out it's the eventloop's INPUT_TIMEOUT of 1s by default).
I think we need at least one timeout (see keyseq-timeout in readline) that can be set to something relatively low, in my case I set it to 10ms. You might also have a look how vim does it, it has ttimeoutlen for keycodes, and then separate timeoutlen for mappings.
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue! This is interesting.
I didn't know about ttimeoutlen. On my system it's 100ms by default. Prompt_toolkit 2.0 (see 2.0 branch) uses 500ms. Maybe we can decrease this. Maybe 200ms or 300ms, but not too much, because Python can be a little slower than C, and we don't want to call it too early.
Further, prompt_toolkit indeed doesn't support timeoutlen yet. I had no idea that Vim has this option. In my setup it's 1000ms for this one. I think we can do the same thing here.
This feature request makes sense. I can probably implement this in the 2.0 branch.
I would like to have VI insert mode bindings for
<M-...>
where by<M->
I don't mean traditional 8bit meta but escape prefixed sequence. E.g.,<M-h>
would be^]h
that isEscape + h
.So I did:
Now that works ok, but it seems to me
prompt_toolkit
doesn't have a notion of timeout for when there are multiple bindings for so far ambiguous input, i.e., with above in place I can't go to command mode just by pressingEscape
. And even if there is no conflicting binding, there is delay (actually as I've figured out it's the eventloop'sINPUT_TIMEOUT
of1s
by default).I think we need at least one timeout (see
keyseq-timeout
inreadline
) that can be set to something relatively low, in my case I set it to10ms
. You might also have a look howvim
does it, it hasttimeoutlen
for keycodes, and then separatetimeoutlen
for mappings.The text was updated successfully, but these errors were encountered: