copy from terminal doesn't work #31902#37290
Conversation
|
|
||
| // We need to listen to the mouseup event up to the document since the user may release the mouse button anywhere | ||
| // outside of _xterm.element. | ||
| this._instanceDisposables.push(dom.addDisposableListener(document, 'mouseup', (event: KeyboardEvent) => { |
There was a problem hiding this comment.
I'd prefer if this listener was only active after a mousedown and disposed of itself on mouseup, otherwise this will run on every mouse click. You can probably do this all within the mousedown listener without the need to introduce more properties to TerminalInstance.
Also this listener will also make it very easy to implement #36271 👍
There was a problem hiding this comment.
Oh you're right: that's much better.
|
@Tyriar I think I made the necessary changes: could you review it again? This bug is driving me crazy :) |
|
And I'm back! I can't actually seem to reproduce, on mac at least. Am I missing something?
|
|
I can reproduce it with Windows 10: maybe this is Windows only ?
Nothing is pasted. If I release the mouse inside the terminal div it works as expected. Edit: that's the version that I installed: |
|
@warpdesign yeah you're right, the problem is actually with the Windows only keybinding which is why I couldn't see it |
|
Made a few tweaks, will merge after CI is happy |
Copy from terminal panel didn't work if the mouse was released outside of the _xterm.element: in this case, the
mouseupevent wasn't triggered.I fixed the problem by adding a boolean to track down when the
mousedownevent is triggered on _xterm.element. In this case, the selection is refreshed when the mouseup event bubbles up to the document.Fixes #31902