davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.35k stars 613 forks source link

Support custom entries with multi-select #807

Open pigmonkey opened 6 years ago

pigmonkey commented 6 years ago

When using the -multi-select option, rofi does not allow selecting both a pre-populated entry and a custom entry.

Version

Version: 1.5.1-dirty (tags/1.5.1)

Configuration

https://gist.github.com/pigmonkey/51ea751d541877c60fdaf1a4e2075071

Launch Command

echo -e "foo\nbar\n" | rofi -dmenu -multi-select

Steps to reproduce

What behaviour you see

What behaviour you expect to see

DaveDavenport commented 6 years ago

The text ~entry~ box is not an entry, it is a filter key for the shown list. Allowing the filter box to be selectable would be counter intuitive. I am not sure how this would work UI wise.

pigmonkey commented 6 years ago

If I launch rofi without the multi-select flag, I can select an entry that was not in the initial list:

$ echo -e "foo\nbar\n" | rofi -dmenu
# type: "baz<Enter>"
baz

If I launch rofi with the multi-select flag, I can still select an entry that was not in the initial list, as long as that is my only selection:

$ echo -e "foo\nbar\n" | rofi -dmenu -multi-select
# type: "baz<Enter>"
baz

It's only when I use -multi-select, and select a value in the list with <Shift><Enter>, and then input a custom value that this behavior breaks:

$ echo -e "foo\nbar\n" | rofi -dmenu -multi-select
# type: "foo<Shift><Enter>"
# clear text and type: "baz<Enter>"
foo

I think it is intuitive to allow the custom entry to be added as the final entry, ie with baz<Enter>.

The <Enter> key tells rofi to exit, so I don't think this adds any UI complexity. If there was support for selecting a custom entry without exiting (ie, baz<Shift><Enter>), then the custom entry would need to be added to the list with the selection indicator next to it, but for my use case, I'm satisfied with the custom entry being the final thing entered.

DaveDavenport commented 6 years ago

@carnager opinion on this?

kpa28-git commented 5 years ago

I second @pigmonkey, especially because -no-custom already exists to disallow custom selections. The current behavior of '-multi-select' is what I would expect with '-multi-select -no-custom'. Doing what @pigmonkey suggests would make dmenu multi-select more exstensible.

andrei-a-papou commented 5 years ago

Agree with @kpatel28. Given -no-custom, the current behavior of -multi-select is a bit inconsistent, IMHO.

Arrow-x commented 1 year ago

Sorry about the necromancy but using dmenu with the multi select patch works the same way as OP suggests, and with rofi's -no-custom option, I think it should be the default. besides if nothing is selected when running multi-select, rofi will output the custom output, which make it very inconsistent