delphix / sdb

The Slick Debugger
Apache License 2.0
57 stars 20 forks source link

Optionally specify readline editing-mode #97

Open sdimitro opened 4 years ago

sdimitro commented 4 years ago

Would folks be interested to support optional vi/vim and emacs editing mode in sdb that would be specified as a command argument? @ahrens @prakashsurya @pcd1193182 ?

This option would be dependent on the underlying readline library that your Python environment uses. If it is libedit for example, you will get an error message that changing keybindings is not supported. In most cases/installations though GNU readline is used which allows us to do things like this:

import readline
readline.parse_and_bind("set editing-mode vi")

https://docs.python.org/3/library/readline.html

pcd1193182 commented 4 years ago

I would definitely be interested in adding readline support. Getting tab completion, keybindings, and rsearch would all be super useful.

prakashsurya commented 4 years ago

I believe we already use readline; and tab completion (perhaps the others, too) should currently work.

I think this issue is more about adding the ability to use vi key-bindings (e.g. similar to set -o vi in bash) with readline.

pcd1193182 commented 4 years ago

Ah, I see. I feel less strongly about that, since I just use the bash/emacs keybinds, but it's probably still a good idea.