JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(tui): 对 Ctrl+D 显示正确的退出信息
liangfuqia90254f8d74f
diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex 9f18f90e82..0d138a6300 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -2595,11 +2595,12 @@ export class AppScreen implements Component, Focusable {requestLocalInterrupt: () => {return this.state.requestLocalInterrupt();},- showCtrlCExitHint: () => {+ showExitHint: (key: string) => {if (this.transientNoticeTimer) {clearTimeout(this.transientNoticeTimer);}- this.transientNotice = "Press Ctrl+C again to exit";+ const keyLabel = key === "ctrl+c" ? "Ctrl+C" : "Ctrl+D";+ this.transientNotice = `Press ${keyLabel} again to exit`;this.transientNoticeTimer = setTimeout(() => {this.transientNotice = null;this.transientNoticeTimer = null;diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/keymap.ts b/jiuwenswarm/channels/tui/frontend/src/ui/keymap.tsindex 097c7ce80f..e3a70d3335 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/keymap.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/keymap.ts@@ -23,8 +23,8 @@ export interface AppScreenKeymapDelegate {* to-exit" timer should be reset.*/requestLocalInterrupt(): boolean;- /** Show a brief hint that pressing Ctrl+C again will exit */- showCtrlCExitHint(): void;+ /** Show a brief hint that pressing the given key again will exit */+ showExitHint(key: string): void;exitApp(): void;toggleTodos(): void;toggleTeamPanel(): void;@@ -74,7 +74,7 @@ function runCtrlC(delegate: AppScreenKeymapDelegate): void {delegate.clearInput();}- delegate.showCtrlCExitHint();+ delegate.showExitHint("ctrl+c");lastInterruptTime = now;}@@ -86,7 +86,7 @@ function runCtrlD(delegate: AppScreenKeymapDelegate): void {}lastInterruptTime = now;delegate.interruptTask();- delegate.showCtrlCExitHint();+ delegate.showExitHint("ctrl+d");}/**