Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed May 23, 2019
1 parent c6b1ac2 commit 08a9808
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/terminal/src/widget.ts
Expand Up @@ -261,21 +261,13 @@ export class Terminal extends Widget implements ITerminal.ITerminal {
}

term.attachCustomKeyEventHandler(event => {
if (
(event.ctrlKey || event.metaKey) &&
event.key === 'c' &&
term.hasSelection()
) {
if (event.ctrlKey && event.key === 'c' && term.hasSelection()) {
// Return so that the usual OS copy happens
// instead of interrupt signal.
return false;
}

if (
(event.ctrlKey || event.metaKey) &&
event.key === 'v' &&
this._options.pasteWithCtrlV
) {
if (event.ctrlKey && event.key === 'v' && this._options.pasteWithCtrlV) {
// Return so that the usual paste happens.
return false;
}
Expand Down

0 comments on commit 08a9808

Please sign in to comment.