From 2a20a7652f9a3234ff74eabe9fb4a339adbd7695 Mon Sep 17 00:00:00 2001 From: AirCoding Date: Wed, 10 Jun 2026 09:24:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(tui):=20Enter=20=E6=8F=90=E4=BA=A4=E6=96=87?= =?UTF-8?q?=E6=9C=AC=EF=BC=8C=E4=B8=8D=E5=86=8D=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenTUI textarea 多行模式下 Enter 默认换行,改为拦截 Enter 调用 submitPrompt() 提交。这是一个命令提示符输入框,不需要多行。 Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/tui/src/TuiApp.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/tui/src/TuiApp.tsx b/packages/tui/src/TuiApp.tsx index ce3fb01..dc10f01 100755 --- a/packages/tui/src/TuiApp.tsx +++ b/packages/tui/src/TuiApp.tsx @@ -349,6 +349,12 @@ function AirCodingView(props: { } } + if (event.name === 'return') { + event.preventDefault() + submitPrompt() + return + } + if (event.ctrl && event.name === 'c') { event.preventDefault() if (textarea && !textarea.isDestroyed && textarea.plainText.length > 0) {