-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
Description
I am trying to oweride ctrl+d with custom command, calling command works but after presing c-d prompt and bottom toolbar are same. (commands.exit() changes prompt and bottom toolbar but) They change only if I pres enter, how can I redraw prompt and bottom toolbar from custom binding?
here is example code
def shell():
"""Repl shell"""
print("Welcome")
prompt = PromptSession(
history=FileHistory(os.path.join(os.path.expanduser("~"), ".history.txt"))
)
commands = Commands()
bindings = KeyBindings()
@bindings.add("c-d")
def _(event):
def print_exit():
print(commands.exit())
run_in_terminal(print_exit)
while True:
try:
user_input = prompt.prompt(
commands.prompt,
auto_suggest=AutoSuggestFromHistory(),
enable_history_search=True,
key_bindings=bindings,
bottom_toolbar=commands.bottom,
)
if not user_input:
continue
except (EOFError, KeyboardInterrupt):
break
Metadata
Metadata
Assignees
Labels
No labels