Skip to content

Commit

Permalink
Focus on mouseup instead of mousedown
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeremyramin committed Nov 17, 2015
1 parent 393342b commit 80633d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80633d5

Please sign in to comment.