-
Can I get the mouse position when the onSelectionChange event triggers? term.onSelectionChange(() => {
term.getSelection() && copyToClipboard(term.getSelection());
console.log('onSelectionChange', term.getSelection());
}) version infoxterm:5.3.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, thats currently not exposed by the selection logic. It also never got asked before, so this seems to be of limited usage/demand. What you can do as a workaround - in |
Beta Was this translation helpful? Give feedback.
No, thats currently not exposed by the selection logic. It also never got asked before, so this seems to be of limited usage/demand.
What you can do as a workaround - in
onSelectionChange
grab the end position of the selection and calc the offset yourself based on the text metrics. Thats also more accurate than the mouse position (mouse might be at half the line/char). With the text metrics you can perfectly align your popup to the text cells.