fix(shell): prevent Enter in AI chat from leaking to terminal
All checks were successful
Beta Release / beta (push) Successful in 48s
All checks were successful
Beta Release / beta (push) Successful in 48s
Stop propagation of Enter keydown in AI input and defer terminal focus to next event loop tick to prevent xterm from capturing the same key event. 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
@@ -693,7 +693,7 @@ export default function Shell({ api }) {
|
||||
|
||||
if (!fromEvent) {
|
||||
setAiInput('')
|
||||
focusAiTerminal()
|
||||
setTimeout(() => focusAiTerminal(), 0)
|
||||
}
|
||||
|
||||
if (trimmed === '/clear') {
|
||||
@@ -937,7 +937,7 @@ export default function Shell({ api }) {
|
||||
<input
|
||||
value={aiInput}
|
||||
onChange={e => setAiInput(e.target.value)}
|
||||
onKeyDown={e => e.key === 'Enter' && handleAiSend()}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); handleAiSend() } }}
|
||||
placeholder={aiAtLimit ? '/clear pour continuer' : t('shell.askAi')}
|
||||
disabled={aiAtLimit && aiInput !== '/clear'}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user