Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from prompt_toolkit.keys import Keys
- from prompt_toolkit.completion import WordCompleter
- @events.on_ptk_create
- def outout_keybindings(prompter, history, completer, bindings, **kw):
- handler = bindings.add
- @handler('escape', 'u') # actually alt+u
- def browse_links_handler(event):
- compl = WordCompleter(['selection1','selection2', 'selection3', 'selection4'])
- usr_sel = prompter.prompt('Enter your selection (TAB-complete): ', completer=compl)
- my_process_selection(usr_sel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement