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

Multi-Select Convenience #401

Open
emrakyz opened this issue May 6, 2024 · 5 comments
Open

Multi-Select Convenience #401

emrakyz opened this issue May 6, 2024 · 5 comments

Comments

@emrakyz
Copy link

emrakyz commented May 6, 2024

Better Behavior

  1. Multi-Select should jump to the next item automatically. This is the default behavior for fzf --multi.
  2. If the item is selected again, the item should be unselected. This is also the default for fzf --multi.

Steps to Reproduce

  • Start a bemenu instance.
  • Select an item with Ctrl + Enter.
  • It stays on the same item.
  • Select the item again; see nothing happens.
example.mp4
@LaptopDev
Copy link

LaptopDev commented Jun 14, 2024

@emrakyz Is your desire to output multiple selections from bemenu at a time?

edit: Currently multi-select requires you to manually select items piped into bemenu with control + enter , where your last selection is chosen by enter.

I can see how it would be a nice feature if the current multi-select selection could be dynamically shifted by shifting the selection in the list. One could, by shifting the selection during keying-down control + enter, expand the multi-select selection leftwards/rightwards or upwards/downwards. I would worry that preserving/recycling such keybind for this behavior would be inappropriate because 1) it would be too challenging, and 2) depending on the user's script to handle bemenu's output, may pose risk to data or security if the purpose is to delete or run code based off of output of bemenu.But it would make bemenu function like a dynamic batch processing front-end.

@Earnestly
Copy link
Contributor

It means that when you press C-Return the cursor moves to the next item in the list.

@LaptopDev
Copy link

It means that when you press C-Return the cursor moves to the next item in the list.

If that's much different maybe I would want to create an issue for the behavior I describe.

@emrakyz
Copy link
Author

emrakyz commented Jun 17, 2024

@LaptopDev

Thanks for the message. You probably misunderstood. The problem is rather simple.

fzf --multi automatically goes to the next entry. This means you don't have to press the "down" arrow or if you use Vim bindings, the l key. When I press Tab the cursor goes to the next item without having to press anything other than Tab.

On the other hand, we have a similar feature for rofi -dmenu -multi-select. When you press Shift + Enter, the cursor goes to the next item immediately. So I can spam Shift + Enter to quickly select 10 different items. For instance, this is very useful for torrenting related scripts. I can select lots of files to increase/decrease their priority or disable downloading them.

For bemenu, in order to select that many items; you need to press CTRL + Enter and then the arrow keys. I think it's a simple convenience.

We can't undo the selections for bemenu either. Both fzf and rofi lets you unselect entries with the same keybindings.

@LaptopDev
Copy link

LaptopDev commented Jun 19, 2024

@emrakyz

I am new to this project and I did not realize we were unable to deselect items in bemenu. Seems like a no-brainer.

Expanding the selection in an automatic fashion to adjacent items is definitely something that would help to quickly define a potentially large multiple selection. To address the behavior you describe, it sounds like you just want Shift + Enter to shift the current item to the next, like rofi does and, with that, Control + Shift + Enter would automatically, then, select the current item and shift the current item to the next, allowing you to quickly add the next item just with Enter (since Control would already be down). Then you would simply lift the Control key up (Shift + Enter) in order to move over items.

I found this issue because I am interested in a dynamic multi-selection solution likened to this approach, but which required less key-binds.

Ideally I would like to be able to move between menu items with vim motions: hjkl
and enter some vi-like visual selection mode for multi-selection where pressing some key would toggle the selection of the active cell/menu-item in a way that would allow deselecting it if pressed again, but also allow vim motions while the key was pressed to flip the selection state of whatever item shifted to. And Enter could still be used to finalize the selections, but would not include or exclude the item it is called on.

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

No branches or pull requests

3 participants