fix: improve placeholder handling and hint height in CLI
- Updated the placeholder text logic to append new fragments after existing ones, preserving the prompt appearance. - Adjusted the hint height to maintain a 1-line spacer while the agent is running, preventing output from crowding the input area.
This commit is contained in:
parent
bff37075f6
commit
5c2926102b
1 changed files with 5 additions and 2 deletions
7
cli.py
7
cli.py
|
|
@ -2097,7 +2097,8 @@ class HermesCLI:
|
||||||
if not ti.document.text and ti.lineno == 0:
|
if not ti.document.text and ti.lineno == 0:
|
||||||
text = self._get_text()
|
text = self._get_text()
|
||||||
if text:
|
if text:
|
||||||
return Transformation(fragments=[('class:placeholder', text)])
|
# Append after existing fragments (preserves the ❯ prompt)
|
||||||
|
return Transformation(fragments=ti.fragments + [('class:placeholder', text)])
|
||||||
return Transformation(fragments=ti.fragments)
|
return Transformation(fragments=ti.fragments)
|
||||||
|
|
||||||
def _get_placeholder():
|
def _get_placeholder():
|
||||||
|
|
@ -2151,7 +2152,9 @@ class HermesCLI:
|
||||||
def get_hint_height():
|
def get_hint_height():
|
||||||
if cli_ref._sudo_state or cli_ref._approval_state or cli_ref._clarify_state:
|
if cli_ref._sudo_state or cli_ref._approval_state or cli_ref._clarify_state:
|
||||||
return 1
|
return 1
|
||||||
return 0
|
# Keep a 1-line spacer while agent runs so output doesn't push
|
||||||
|
# right up against the top rule of the input area
|
||||||
|
return 1 if cli_ref._agent_running else 0
|
||||||
|
|
||||||
spacer = Window(
|
spacer = Window(
|
||||||
content=FormattedTextControl(get_hint_text),
|
content=FormattedTextControl(get_hint_text),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue