🐛 fix(vscode): 审查意见等多行消息发进会话后自动提交,不再只停在输入框
This commit is contained in:
1 parent
834c6cda1a
commit
961a4e9756
2 files changed
+6
-11
No files matched your search
@@ -489,9 +489,7 @@ async function triggerAutoReviewTabUnlocked(panel: KanbanWebviewPanel, opts: {
|
||||
reasoningEffort: settings.codexReasoningEffort,
|
||||
}))
|
||||
// codex resume rebuilds the conversation from the jsonl rollout
|
||||
// before the TUI accepts input — empirically much slower than the
|
||||
// 250ms gap the reuse path uses. 8s is a conservative guess that
|
||||
// covers a cold codex start without feeling laggy.
|
||||
// before the TUI accepts input; 8s covers a cold codex start.
|
||||
setTimeout(() => {
|
||||
submitToSessionTerminal(terminal, 'PR 更新了,再审一下')
|
||||
}, 8000)
|
||||
|
||||
@@ -78,16 +78,13 @@ export function injectIntoImplTerminal(panel: KanbanWebviewPanel, issueNumber: n
|
||||
/**
|
||||
* 往正在跑 cc / codex TUI 的终端里提交一条消息。
|
||||
*
|
||||
* TUI 在 raw 模式下,LF (\n) 只算输入框内的换行,CR (\r) 才会被识别为
|
||||
* Enter。实测多行内容 + 末尾 \r 在同一次 sendText 里发出去时,TUI 进入
|
||||
* 多行输入模式后不会把紧跟的 \r 当成提交键,内容只粘贴到输入框、没提交。
|
||||
* 所以拆两次发:先把内容完整推进输入框,250ms 后再独立发一个 \r 作为 Enter。
|
||||
* sendText 把文本当成逐字敲键盘,TUI 靠输入速度猜是不是粘贴,猜成粘贴后
|
||||
* 会把紧跟的回车也吞成换行,消息只停在输入框。用括号粘贴标记
|
||||
* (\x1B[200~ … \x1B[201~) 明确告诉 TUI 粘贴从哪到哪,之后的 \r 才被当成提交键。
|
||||
*/
|
||||
export function submitToSessionTerminal(terminal: Terminal, text: string): void {
|
||||
terminal.sendText(text, false)
|
||||
setTimeout(() => {
|
||||
terminal.sendText('\r', false)
|
||||
}, 250)
|
||||
terminal.sendText(`\x1B[200~${text}\x1B[201~`, false)
|
||||
terminal.sendText('\r', false)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user