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
Impossible to select whole line #58
Comments
I cannot replicate this, Dragginf from F to e selects the text "First line" with no trailing newline. Triple clicking the line also selects "First line" I'm not particularly interested in trying to implement a way to get the trailing newline into the selection, since this is impossible to do robustly, think of the case when the last character in the line is also the last cell of the terminal display |
Triple click works for a single line, but there doesn't seem to be a way to select several? Dragging exactly to the end of the line works, but that requires concentration (hello Fitts's law). It would make more sense if the trailing spaces were stripped from the end (this is indeed the behavior of other terminals I've tried). |
Huh? Dragging past the end of the line in most terminals does not strip trailing spaces -- I tested termite, xterm and konsole. And you can select a single line easily using triple click. If you need to select multiple, a little precision is required, that is generally true for selecting any region. |
Here's what I mean by selecting multiple lines: Dragging the mouse from the left dot to the right copies:
Note the spaces on the last line (and only the last line). Doing the same movement in xterm or termite trims the last line properly. Here's trying to select multiple lines by dragging to the start of the next line. I dragged the mouse from the upper to the lower dot: This copies the opening bracket on the end, whereas both xterm and termite do not select or copy it if the cursor is before the character. I think I've found the place where the selection logic happens, will you accept a pull request changing the behavior in line with the other terminals? |
Sure, send a PR. I cannot promise I will accept it, but, I will review it. Note that you cannot just blindly insert a newline at the end of the last line. You have to check if the next line is continued or not. If it is -- no newline, if it isn't, add a newline. |
When the following text is displayed in the terminal:
It is impossible to select "First line" with the ending newline by itself.
If I drag the mouse to before "S" in "Second line", it is impossible not to select "S", so the smallest possible selection is
First line\nS
.If I drag the mouse past the end of "First line" (on the same line), "First line" is selected, followed by all the whitespace between the end of the line and mouse position. Note that other terminals in this case select
First line\n
, though selecting justFirst line
is acceptable too.The text was updated successfully, but these errors were encountered: