From b45c7028efe468da93b2bb264eab615f8449bfe9 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Wed, 30 Apr 2025 14:26:07 +0800 Subject: [PATCH] Update commandHistory.store.ts --- packages/frontend/src/stores/commandHistory.store.ts | 5 +++++ 1 file changed, 5 insertions(+) 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; // 不添加空命令 }