-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text-selection is lost when data is written outside of the viewport #468
Comments
Great idea @foot! Should be an easy fix and a great optimization for when you're looking at scrollback. I mention something similar in the linkify proposal #455 where I want us to shift rows up instead of redrawing the entire viewport when there is a new row. I'll keep this open to make sure this case is handled 😃 |
When can this problem be solved?I had tried to sovle it by adding other MouseEvents in my local codes. Firstly, I add the actual row number on each div,which is in the function '_refresh' that in the file of Renderer.ts,as follows:
Then I use the API document.caretRangeFromPoint to get the Range Informations when mousedown and mouseup. Then, the Terminal.lines._array had cached will to be used to select the actual Range which user chooses.Finally,window.getSelection.addRange(Range). Howerver, it is so difficult.The selection will disappear when I user the scrollDisp(1). :( |
@SimonHui931208 selection is going to be completely rewritten soon in #207 which should fix this by managing what is selected ourselves, rather than trying to bend standard web selection to our will. |
Fixed in #670 |
This is sort of a sub-case of #318 that feels like it could be an easier fix.
Perhaps we could avoid redrawing the terminal if the updated lines fall outside the current viewport. I'm not sure if this would be an easy fix so please close this issue if time would be better spent pursuing a proper fix for #318 etc.
Big use case here is scrolling back through
tail -f
'd logs and trying to copy and paste them.Details
Steps to reproduce
while true; do echo 1; sleep 1; done
Cheers!
The text was updated successfully, but these errors were encountered: