From 42aae1d9f168599248fafb6b4515176ada4d7a64 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 17 Feb 2021 21:32:36 -0800 Subject: [PATCH] Fix search/copy on osx --- resources/scripts/components/server/Console.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/resources/scripts/components/server/Console.tsx b/resources/scripts/components/server/Console.tsx index 22d035a6c..4301cd974 100644 --- a/resources/scripts/components/server/Console.tsx +++ b/resources/scripts/components/server/Console.tsx @@ -144,23 +144,16 @@ export default () => { // Add support for capturing keys terminal.attachCustomKeyEventHandler((e: KeyboardEvent) => { - // Ctrl + C (Copy) - if (e.ctrlKey && e.key === 'c') { + if (e.metaKey && e.key === 'c') { document.execCommand('copy'); return false; - } - - // Ctrl + F (Find) - if (e.ctrlKey && e.key === 'f') { + } else if (e.metaKey && e.key === 'f') { + e.preventDefault(); searchBar.show(); return false; - } - - // Escape - if (e.key === 'Escape') { + } else if (e.key === 'Escape') { searchBar.hidden(); } - return true; }); }