mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: Ctrl+D deletes char under cursor, only exits on empty input (bash/zsh behaviour)
This commit is contained in:
parent
1dcf79a864
commit
08d5c9c539
1 changed files with 9 additions and 3 deletions
12
cli.py
12
cli.py
|
|
@ -9557,9 +9557,15 @@ class HermesCLI:
|
||||||
|
|
||||||
@kb.add('c-d')
|
@kb.add('c-d')
|
||||||
def handle_ctrl_d(event):
|
def handle_ctrl_d(event):
|
||||||
"""Handle Ctrl+D - exit."""
|
"""Ctrl+D: delete char under cursor (standard readline behaviour).
|
||||||
self._should_exit = True
|
Only exit when the input is empty — same as bash/zsh.
|
||||||
event.app.exit()
|
"""
|
||||||
|
buf = event.app.current_buffer
|
||||||
|
if buf.text:
|
||||||
|
buf.delete()
|
||||||
|
else:
|
||||||
|
self._should_exit = True
|
||||||
|
event.app.exit()
|
||||||
|
|
||||||
_modal_prompt_active = Condition(
|
_modal_prompt_active = Condition(
|
||||||
lambda: bool(self._secret_state or self._sudo_state)
|
lambda: bool(self._secret_state or self._sudo_state)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue