diff --git a/packages/frontend/src/stores/commandHistory.store.ts b/packages/frontend/src/stores/commandHistory.store.ts index 686edaf..abe4c52 100644 --- a/packages/frontend/src/stores/commandHistory.store.ts +++ b/packages/frontend/src/stores/commandHistory.store.ts @@ -110,6 +110,11 @@ export const useCommandHistoryStore = defineStore('commandHistory', () => { // 添加命令到历史记录 (由 CommandInputBar 调用, 添加后清除缓存) const addCommand = async (command: string) => { + // NEW: Filter out Ctrl+C signal (\x03) from being added to history + if (command === '\x03') { + console.log('[CmdHistoryStore] Ignoring Ctrl+C signal for history.'); + return; + } if (!command || command.trim().length === 0) { return; // 不添加空命令 }