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

[REQUEST] Including Select All Text as keybinding #1912

Closed
2 tasks done
D3vil0p3r opened this issue Oct 29, 2023 · 15 comments
Closed
2 tasks done

[REQUEST] Including Select All Text as keybinding #1912

D3vil0p3r opened this issue Oct 29, 2023 · 15 comments

Comments

@D3vil0p3r
Copy link

Before opening a feature request

  • I checked the next branch to see if the feature has already been implemented
  • I searched existing reports to see if it is already requested.

What is the user problem or growth opportunity you want to see solved?

To improve efficiency on the usage, I would like to have for me and for the users the chance to configure the keybinding to select all the text typed in Rofi textbox.

How do you know that this problem exists today? Why is this important?

I gave a look on https://github.com/davatorium/rofi/blob/next/doc/rofi-keys.5.markdown but I don't see it.

Who will benefit from it?

Improve efficiency on text manipulation.

Rofi version (rofi -v)

Version: 1.7.5

Configuration

https://gist.github.com/D3vil0p3r/3e814ffc4f11386021c0da9774c49752

Additional information

No response

@D3vil0p3r D3vil0p3r changed the title [REQUEST] [REQUEST] Including Select All Text as keybinding Oct 29, 2023
@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Oct 29, 2023

To improve efficiency on the usage

Can you provide a use-case of what a 'select all text in input' would improve?
You don't answer the question of what problem this solves (or improves)

Please answer the questions asked in the template.

How do you know that this problem exists today? Why is this important?

I gave a look on https://github.com/davatorium/rofi/blob/next/doc/rofi-keys.5.markdown but I don't see it.

This answers that the proposed solution does not exists, not the problem.

Who will benefit from it?

Improve efficiency on text manipulation.

This is not an answer to the question asked.

@D3vil0p3r
Copy link
Author

To improve efficiency on the usage

Can you provide a use-case of what a 'select all text in input' would improve? You don't answer the question of what problem this solves (or improves)

It saves time by eliminating the need to select individual strings, so quick text manipulation; copy and paste, for example if I write some string there, and I need to copy and paste somewhere, I can do it quickly; accessibility, maybe it can give a little help to people that could have some disabilities.

Please answer the questions asked in the template.

How do you know that this problem exists today? Why is this important?
I gave a look on https://github.com/davatorium/rofi/blob/next/doc/rofi-keys.5.markdown but I don't see it.

This answers that the proposed solution does not exists, not the problem.

This is not a problem. This is a feature request. Maybe the question should be rephrased, or maybe the question "What are the problems you are facing without this feature?" is needed.

Who will benefit from it?
Improve efficiency on text manipulation.

This is not an answer to the question asked.
Of course all the users and people with disabilities.

Of course my dear we can have a different perception on how this kind of features can be important, for example a "select all text" could sound trivial on your side but for the average users the perception/feeling on this could be different.

Feel free to consider it. If not, don't worry.

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Oct 29, 2023

Given that rofi does not support text selection, I am still unsure what problem you are trying to solve with a 'select all text' keybinding. This is why this is asked.

It saves time by eliminating the need to select individual strings,

You cannot select individual strings in rofi.

I am now even more confused by your feature request and your reason for it?

so quick text manipulation; copy and paste

you can paste into rofi, or copy the selected entry to clipboard (git).
You want an extra binding that can copy the whole input box to the clipboard?

Of course all the users and people with disabilities.

Can you explain how this feature would help?

Of course my dear we can have a different perception on how this kind of features can be important, for example a
"select all text" could sound trivial on your side but for the average users the perception/feeling on this could be different.

There are a lot of keybindings implemented in rofi to help with editing the text in the entry. like delete word forward/back, move word forward back, move to start/end, delete to start/end etc. Clear line, etc.
What extra operation would select all text add that would help?

As I mentioned before, I am willing to consider feature requests, but it helps to have a clear use-case for it or problem it solves. Given rofi's current features I do not see a use-case or the problem it solves.

@D3vil0p3r
Copy link
Author

Nevermind, we can close the ticket.

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Oct 29, 2023

Why not answer the question?

I would like to improve usability where possible, but I truely do not see what improvement a keybinding that selects all text would bring?
We don't have text-selection in rofi's entry box, so I have a hard time understanding the added value. We already have a lot of keybindings to help editing text. If something is missing I would like to improve this, especially if it makes rofi more accessible for people with disabilities, as you stated?

So can you please describe the use-case for this feature? or describe the problem that is there and this addition would fix. This would help me, and the people I asked to help me understand the request, understand what you want added.

Of course my dear we can have a different perception on how this kind of features can be important, for example a "select all text" could sound trivial on your side but for the average users the perception/feeling on this could be different.

It is hard to judge the importance of the feature if I don't understand the problem it tries to resolve.

@D3vil0p3r
Copy link
Author

Not sure if I can explain better than my previous comments, but it is my problem that Im not able to transmit my feeling. Let's see if other users join this discussion to share their point of view.

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Oct 29, 2023

I tried to break down your previous comment, but you have not replied on my breakdown and the questions in there.

I really tried to understand, so lets try this again. Your comment that provided more explanation was:

It saves time by eliminating the need to select individual strings, so quick text manipulation; copy and paste, for example if I write some string there, and I need to copy and paste somewhere, I can do it quickly; accessibility, maybe it can give a little help to people that could have some disabilities.

I'll try to break it down again and be more verbose:

It saves time by eliminating the need to select individual strings

We do not have support for making a selection in the entry box of rofi. So this one I do not understand, how does selecting all text eliminates the need for something that is not supported in the first place.

Is the request for text selection then? If yes, we can discuss this.

so quick text manipulation; copy and paste, for example if I write some string there, and I need to copy and paste somewhere, I can do it quickly;

Lets split this in two:

  • paste:
    In most programs if you select text then hit paste you normally replace the whole selection with the content of the clipboard.
    So selecting all text and then pasting replaces the whole entry box. This is already possible with the same amount of keybindings hits currently. (Control-W to clear the line, and then the paste keybinding for the desired clipboard)

  • copy:
    Select all and copy the text to clipboard is something that is currently not supported. That is why in my reply above I asked if this is what you want to be added?

You want an extra binding that can copy the whole input box to the clipboard?

Is this the problem we are trying to solve? if yes, we can discuss this.

accessibility, maybe it can give a little help to people that could have some disabilities.

I really would like to improve usability to people with disabilities, but this to me does not add more information.

@D3vil0p3r
Copy link
Author

I tried to break down your previous comment, but you have not replied on my breakdown.

I really tried to understand, so lets try this again. Your comment that provided more explanation was:

It saves time by eliminating the need to select individual strings, so quick text manipulation; copy and paste, for example if I write some string there, and I need to copy and paste somewhere, I can do it quickly; accessibility, maybe it can give a little help to people that could have some disabilities.

I'll try to break it down again and be more verbose:

It saves time by eliminating the need to select individual strings

We do not have support for making a selection in the entry box of rofi. So this one I do not understand, how does selecting all text eliminates the need for something that is not supported in the first place.

What I mean needs the selection in the entry box of rofi, so if it is not supported, the entire request falls. Because a simple use case I'm imaging now is: I have rofi to search applications. Let's guess I write on rofi bar Firefox Nightly ESR. Then, I realize I want to search only Firefox, and I need to delete Nightly ESR char by char by backspace key. If I could select them by a shortcut to highlight entire words, I could delete them in few seconds. But it is possible only if there is the support of making a selection in the entry box of rofi. If it is not supported, it cannot be done.

Is the request for text selection then? If yes, we can discuss this.

so quick text manipulation; copy and paste, for example if I write some string there, and I need to copy and paste somewhere, I can do it quickly;

Lets split this in two:

  • paste:
    In most programs if you select text then hit paste you normally replace the whole selection with the content of the clipboard.
    So selecting all text and then pasting replaces the whole entry box. This is already possible with the same amount of keybindings hits currently. (Control-W to clear the line, and then the paste keybinding for the desired clipboard)
  • copy:
    Select all and copy the text to clipboard is something that is currently not supported. That is why in my reply above I asked if this is what you want to be added?

Ok for paste, I agree with you. About copy, a use case could be the same example I did above, where I want to only one string of the entire input, for example Nightly, but still it needs the support of text selection.

You want an extra binding that can copy the whole input box to the clipboard?

Is this the problem we are trying to solve? if yes, we can discuss this.

Related to copy topic, yes but not the only one (look my comment here above about copy to copy substrings)

accessibility, maybe it can give a little help to people that could have some disabilities.

I really would like to improve usability to people with disabilities, but this to me does not add more information.
Accessibility is a consequence of what I reported here.

Sorry if I'm still unclear.

@DaveDavenport
Copy link
Collaborator

What I mean needs the selection in the entry box of rofi, so if it is not supported, the entire request falls. Because a simple use case I'm imaging now is: I have rofi to search applications. Let's guess I write on rofi bar Firefox Nightly ESR. Then, I realize I want to search only Firefox, and I need to delete Nightly ESR char by char by backspace key. If I could select them by a shortcut to highlight entire words, I could delete them in few seconds. But it is possible only if there is the support of making a selection in the entry box of rofi. If it is not supported, it cannot be done.

There is already a feature implemented to make this easier; there currently exists a keybinding to delete one word back, so the above usecase takes hitting this keybinding twice to do what you want efficiently.
For the keybinding see the manpage you linked above.

This is a different request then the original feature request, where you wanted to a 'select all'.
This is exactly the reason why I ask for a use-case or a description of the problem you are facing as this makes it clear what it is you actually want. I don't have the context to your request that you naturally have, so I need to infer this from the information provided. So the more relevant information I have, the better I can understand the request.

Ok for paste, I agree with you. About copy, a use case could be the same example I did above, where I want to only one string of the entire input, for example Nightly, but still it needs the support of text selection.

This is also again different then the original feature request and further explanation.
I think I now understand what you want.

Related to copy topic, yes but not the only one (look my comment here above about copy to copy substrings)

Copying the content of the entire entry box I can easily add.

So I think the request is adding support for text selection.

I'll try to answer this one:

First this is a non-trivial feature to add in the current implementation but doable. It would be a big investment of time to get this done. I am very short on time, answering question takes up most time I have already. So development time is very limited. (I haven't found time to make a new release for the past half year). So this needs to be heavily upvoted issue, or somebody needs to provide an PR.

I personally think most of the use-case for a selection (beside copy (1)) is already possible via the keyboard:

Rofi main utility is a keyboard driven filter for interacting with lists. Mouse interaction is mostly an afterthought and not its focus.
It tries to provide keybindings to efficiently interact with this. This includes a lot of text manipulation/cursor moving bindings and the default bindings are based on emacs binding that is the default in a lot of (linux) tools (like terminals), but is fully customizable to fit the users need/limitation.
Most things (beside copy (1)) should already be possible with these keybindings:

  • kb-clear-line - Control+w
  • kb-move-front - Control+a
  • kb-move-end - Control+e
  • kb-move-word-back - Alt+b,Control+Left
  • kb-move-word-forward - Alt+f,Control+Right
  • kb-move-char-back - Left,Control+b
  • kb-move-char-forward - Right,Control+f
  • kb-remove-word-back - Control+Alt+h,Control+BackSpace
  • kb-remove-word-forward - Control+Alt+d
  • kb-remove-char-forward - Delete,Control+d
  • kb-remove-char-back - BackSpace,Shift+BackSpace,Control+h
  • kb-remove-to-eol - Control+k
  • kb-remove-to-sol - Control+u

Using copy can be useful for moving (sub)strings in the textbox of rofi, this is normally not needed as ordering of the words (unless configured differently) does not affect the behaviour (its a tokenized search). (firefox nightly should give same result as nightly firefox).

[1] copy is something I have not added until recently to rofi. This is because how clipboards (to my understanding) works in X11 is that the application that has the selection owns it. So if the application is closed, the selection is gone and you cannot paste the text anymore. Given that rofi is a modal application that blocks interaction with other application while it is running, copying text to the clipboard is normally gone at the point the user would want to paste it somewhere else. An external clipboard manager could fix this, this is why I've added it in git (for copying the selected entry in the listview, the things that has been requested in the past).

@D3vil0p3r
Copy link
Author

Thank you very much for the detailed explanation.

@tuananh
Copy link

tuananh commented Apr 28, 2024

my use case is: sometimes when i type sth wrong, i just want to select all and delete and type again. it's just my personal habbit.

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Apr 28, 2024

@tuananh there are keybindings to quickly clear input. It would not save any keystrokes.
please read my long reply above, beside explaining that adding selection it self is not trivial, it also lists these keybindings. (the default keybinding for deleting also work in most terminals and entry boxes, so they are not rofi specific).

@tuananh
Copy link

tuananh commented Apr 28, 2024

Thanks. That works for me.

@DaveDavenport
Copy link
Collaborator

closing this issue for now . Copy has been implemented now and I think my above should be sufficient.

If somebody has a very good use-case (please read this whole post) please open a new issue.

@DaveDavenport DaveDavenport closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants