feat: Ctrl+C 中断 Agent 运行(而非退出应用)
- 使用 Ink.render(component, false) 禁用默认 Ctrl+C 退出 - Ctrl+C 在 Agent 运行中触发 cancel(),停止当前循环 - Ctrl+C 在空闲时清空输入 - 保留 Ctrl+D 作为退出快捷键 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -93,8 +93,8 @@ public class JinkReplSession {
|
|||||||
conversationSummary = text.length() > 40 ? text.substring(0, 40) : text;
|
conversationSummary = text.length() > 40 ? text.substring(0, 40) : text;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 启动 jink 渲染
|
// 启动 jink 渲染(exitOnCtrlC=false,让组件处理 Ctrl+C)
|
||||||
inkApp = Ink.render(component);
|
inkApp = Ink.render(component, false);
|
||||||
|
|
||||||
// 拦截 System.out/err,防止日志干扰 TUI
|
// 拦截 System.out/err,防止日志干扰 TUI
|
||||||
inkApp.patchConsole();
|
inkApp.patchConsole();
|
||||||
|
|||||||
Reference in New Issue
Block a user