mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
opentui(v6): tray-exit Esc never arms the prompt-history double-press
This commit is contained in:
parent
4c630d3e7b
commit
f4bb617f62
2 changed files with 5 additions and 1 deletions
|
|
@ -133,6 +133,10 @@ export function AgentsTray(props: {
|
|||
boxRef?.blur()
|
||||
setFocused(false)
|
||||
props.onExit?.()
|
||||
// A tray-exit Esc is CONSUMED — without this, a composer remount can
|
||||
// register its handler after ours and the same keystroke would arm the
|
||||
// Esc+Esc prompt-history double-press (Epic 5 review caveat).
|
||||
key.preventDefault()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ export function Composer(props: {
|
|||
// With text in the buffer the Esc is just an intervening key (disarms);
|
||||
// unfocused (e.g. the agents tray owns the keys) it never counts.
|
||||
if (key.name === 'escape' && key.eventType !== 'release' && !key.ctrl && !key.meta && !key.option) {
|
||||
if (ta?.focused === true && ta.plainText === '') {
|
||||
if (ta?.focused === true && ta.plainText === '' && !key.defaultPrevented) {
|
||||
if (doubleEsc.press()) props.onDoubleEsc?.()
|
||||
} else {
|
||||
doubleEsc.reset()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue