Fix search/copy on osx

This commit is contained in:
Dane Everitt 2021-02-17 21:32:36 -08:00
parent b92712e990
commit 42aae1d9f1
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
1 changed files with 4 additions and 11 deletions

View File

@ -144,23 +144,16 @@ export default () => {
// Add support for capturing keys // Add support for capturing keys
terminal.attachCustomKeyEventHandler((e: KeyboardEvent) => { terminal.attachCustomKeyEventHandler((e: KeyboardEvent) => {
// Ctrl + C (Copy) if (e.metaKey && e.key === 'c') {
if (e.ctrlKey && e.key === 'c') {
document.execCommand('copy'); document.execCommand('copy');
return false; return false;
} } else if (e.metaKey && e.key === 'f') {
e.preventDefault();
// Ctrl + F (Find)
if (e.ctrlKey && e.key === 'f') {
searchBar.show(); searchBar.show();
return false; return false;
} } else if (e.key === 'Escape') {
// Escape
if (e.key === 'Escape') {
searchBar.hidden(); searchBar.hidden();
} }
return true; return true;
}); });
} }