Skip to content
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

Double click selects too much #252

Open
x10000year opened this issue Nov 6, 2021 · 8 comments
Open

Double click selects too much #252

x10000year opened this issue Nov 6, 2021 · 8 comments
Assignees
Labels
feature New feature

Comments

@x10000year
Copy link

x10000year commented Nov 6, 2021

For a text line:

abc.def.ghi

When I double click on e, I want to select def (and copy it). But in windterm it selects the whole line.

@x10000year x10000year changed the title Double click selecs too much Double click selects too much Nov 6, 2021
@kingToolbox
Copy link
Owner

I can only say that everyone's needs are different, 😄 and the current selection should be what is needed in most scenarios. In fact, WindTerm has also specially added the smart selection feature for different needs. WindTerm can select different parts of the text when you clicking on the separator boundary.

But the above feature still does not solve your needs. Because the dot is considered part of the word. So you also need to open the session settings dialog, then add a . to Window - Selection - Word Separators and reconnect, then you will get what you want.

But the new problem is that when you click the number of 127.127.127.127, you will find that you can only select 127 instead of the whole IP. So, the choice is up to you. 😄

@x10000year
Copy link
Author

in other tools like xshell, '.' and '/' are usually boundaries. in xshell, if i double click, i select the real word, if i click 3 times, i select the longer segment.

when we are editing source code in vim (a very common scenario?), we usually want to select an identifier instead of something like a.b.c.d or a/b/c/d.

@kingToolbox
Copy link
Owner

WindTerm also has the three-click function, which is used to quickly select the entire line. But the reason why it is designed like this is to reduce the number of clicks, and hope that after a double-click, you can quickly get the selection you want.

Of course, because everyone's needs are different, it is impossible to cover everything. This is why the options are provided in order to allow you to customize.

Just as although vim is a very common scene, there are many such scenes. For example, when you see a url www.github.com or path /home/user/test/ or file name runme.sh, what you want to select when you double-click will hardly be just a word, but a whole. This is a more common need for most people.

If you have tried WindEdit, then you will find that in WindEdit, double-clicking abc.def.ghi selects the word by default. This is because different tools target different user groups, so even if they are all developed by me, the same functions will have different designs.

The last consideration is that it is easier to choose the shorter text than the longer text, so the long text is selected by default, even if occasionally it is not what the user wants, the user can easily choose the short text by himself.

@kingToolbox
Copy link
Owner

When I was writing the above comment, I suddenly thought of a good idea. That is, when WindTerm detects that you are entering vim, the dot and backslash and so on will be automatically added to Word Separators, and they will also be automatically cleared when you exiting vim, so that WindTerm can provide you with a better experience. 😄

This feature will be implemented in the WindTerm_2.2.0 version. Please stay tuned, thank you.

@kingToolbox kingToolbox self-assigned this Nov 6, 2021
@kingToolbox kingToolbox added the feature New feature label Nov 6, 2021
@x10000year
Copy link
Author

can it just be when user ALT+double click, it selects the real word/identifier?

some people uses laptop, for which selection by mouse is always inconvenient.

@kingToolbox
Copy link
Owner

Have you tried adding . to Session Property Dialog - Window - Selection - Word Separators? After modifying the settings, it should be enough to meet your needs. As you pointed out, XShell treats . as a word separator by default, but WindTerm not, which caused this problem.

Double-clicking is very convenient, but having to press the Alt key when double-clicking is complicated. Moreover, I have reserved the Alt + Click for the proposal Move cursor by mouse clicking you submitted. 😄

@vplesnila
Copy link

Hello

Maybe I misunderstood how "Word Separators" works, but I will share my example.

For the current session I have Word Separators `!#$^*()=[{]}|;:'",<>?
Note that ":"" character is included.

Now, I have the text:

root@vmi790070:/app/persistent_docker/tiddlywiki

When I double click on "root" the selected text is: "root@vmi790070" and that's perfect.
But doble clicking on "tiddlywiki" will select the whole line: "root@vmi790070:/app/persistent_docker/tiddlywiki" while, I expected to select only "/app/persistent_docker/tiddlywiki" because ":" is in my list of my Word Separators.
It's like this separator works only when the double clicked word is on the left of the separator.

Any idea?

Thank you.

@griffin-warrior
Copy link

I can only say that everyone's needs are different, 😄 and the current selection should be what is needed in most scenarios. In fact, WindTerm has also specially added the smart selection feature for different needs. WindTerm can select different parts of the text when you clicking on the separator boundary.

But the above feature still does not solve your needs. Because the dot is considered part of the word. So you also need to open the session settings dialog, then add a . to Window - Selection - Word Separators and reconnect, then you will get what you want.

But the new problem is that when you click the number of 127.127.127.127, you will find that you can only select 127 instead of the whole IP. So, the choice is up to you. 😄

Is there any option to disable this 'smart selection' feature? I often encounter situations that only part of what I want is selected, which is rather counter-intuitive to the standard terminal behavior. And to avoid triggering 'smart selection' needs special attentions which is realy a great burden for common users.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

4 participants