From 01649fad64ccfde4dca6506d5d209005bec49779 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 24 Dec 2024 15:38:54 -0700 Subject: [PATCH] enh: esc to stop response --- src/lib/components/chat/MessageInput.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 4ea29b847..2af90ae91 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -710,6 +710,10 @@ const commandsContainerElement = document.getElementById('commands-container'); + if (e.key === 'Escape') { + stopResponse(); + } + // Command/Ctrl + Shift + Enter to submit a message pair if (isCtrlPressed && e.key === 'Enter' && e.shiftKey) { e.preventDefault(); @@ -893,6 +897,9 @@ const commandsContainerElement = document.getElementById('commands-container'); + if (e.key === 'Escape') { + stopResponse(); + } // Command/Ctrl + Shift + Enter to submit a message pair if (isCtrlPressed && e.key === 'Enter' && e.shiftKey) { e.preventDefault();