diff --git a/ptpython/key_bindings.py b/ptpython/key_bindings.py index d7bb575..81d1f99 100644 --- a/ptpython/key_bindings.py +++ b/ptpython/key_bindings.py @@ -217,6 +217,14 @@ def _(event: E) -> None: "Abort when Control-C has been pressed." event.app.exit(exception=KeyboardInterrupt, style="class:aborting") + @handle("backspace", filter=(vi_insert_mode | emacs_insert_mode)) + def _(event: E) -> None: + """ + Display autocomplete menu on backspace + """ + get_by_name("backward-delete-char").call(event) + event.current_buffer.start_completion(select_first=False) + return bindings