From 7abadfd401b130a9a7e40d71819d63f41c949db1 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Tue, 6 May 2025 11:27:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A9=BA=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=20Ctrl+C=20=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/views/WorkspaceView.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/views/WorkspaceView.vue b/packages/frontend/src/views/WorkspaceView.vue index 8559770..bcf5c3d 100644 --- a/packages/frontend/src/views/WorkspaceView.vue +++ b/packages/frontend/src/views/WorkspaceView.vue @@ -183,9 +183,13 @@ onBeforeUnmount(() => { if (terminalManager && typeof terminalManager.sendData === 'function') { const commandToSend = command.trim(); - console.log(`[WorkspaceView] Sending command to active session ${currentSession.sessionId}: ${commandToSend}`); - terminalManager.sendData(command + '\r'); - if (commandToSend.length > 0) { + console.log(`[WorkspaceView] Sending command/data to active session ${currentSession.sessionId}: ${JSON.stringify(command)}`); // Log raw command + // Only append '\r' for regular commands, not for control characters like Ctrl+C (\x03) + const dataToSend = command === '\x03' ? command : command + '\r'; + terminalManager.sendData(dataToSend); + // Add to history only if it's a user-typed command (not just Enter or control chars) + const commandToHistory = command.trim(); + if (commandToHistory.length > 0 && command !== '\x03') { commandHistoryStore.addCommand(commandToSend); } } else {