From 80633d59b541e8bf9596d5575646cc9f8c248744 Mon Sep 17 00:00:00 2001 From: Jeremy Ebneyamin Date: Mon, 16 Nov 2015 20:30:38 -0800 Subject: [PATCH] Focus on mouseup instead of mousedown Focus the terminal on mouseup if the button is not the right mouse button. In addition, do not focus if there is text selected to prevent the selection from disappearing. --- lib/view.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/view.coffee b/lib/view.coffee index 13bec58..1408cbd 100644 --- a/lib/view.coffee +++ b/lib/view.coffee @@ -64,9 +64,11 @@ class TerminalPlusView extends View event.preventDefault() event.stopPropagation() - @xterm.on 'mousedown', (event) => + @xterm.on 'mouseup', (event) => if event.which != 3 - @focus() + text = window.getSelection().toString() + unless text + @focus() @xterm.on 'dragenter', override @xterm.on 'dragover', override @xterm.on 'drop', @recieveItemOrFile