Skip to content

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): /keybindings编辑器退出时,误判为tui退出

kdgmpwd0e7bcdc8ce1
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/utils/editor.ts b/jiuwenswarm/channels/tui/frontend/src/core/utils/editor.ts
index fc91c2b790..e5fbc5786f 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/utils/editor.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/utils/editor.ts
@@ -43,8 +43,14 @@ export function getEditorInfo(): { source: string; value: string } {
}
export function isGuiEditor(editor: string): boolean {
- const base = basename(editor.split(" ")[0] ?? "");
- return GUI_EDITORS.some((gui) => base.includes(gui));
+ // Check all parts of the command, not just the first word.
+ // On Windows, the default editor is "start /wait notepad" — the actual
+ // editor name ("notepad") is in the arguments, not the command itself.
+ return editor.split(/\s+/).some((token) => {
+ if (!token) return false;
+ const base = basename(token);
+ return GUI_EDITORS.some((gui) => base.includes(gui));
+ });
}
export function parseEditorCommand(editor: string): { cmd: string; args: string[] } {