Skip to content

fix: name parsing with slashes - #115

Closed
sofurs wants to merge 1 commit into
fdw:mainfrom
sofurs:main
Closed

fix: name parsing with slashes#115
sofurs wants to merge 1 commit into
fdw:mainfrom
sofurs:main

Conversation

@sofurs

@sofurs sofurs commented Jul 15, 2025

Copy link
Copy Markdown

Rofi-rbw fails to retrieve entries with slashes after parsing.

Example:
folder: Web, entry name: github.com/main-account

rofi-rbw matches Web/github.com as folder and main-account as entry name. This results in Could not parse the output: Expecting value error message because no entry with the name of main-account is found.

This fails due to the greedy .+ regex operator in __parse_formatted_string method. My proposed solution is to make the .+ matching non-greedy by appending the ? operator, thus the result of parsing is:

folder: Web, entry name: github.com/main-account

@fdw

fdw commented Jul 15, 2025

Copy link
Copy Markdown
Owner

Hey, thanks for the PR!

I've tested it a bit and it seems that the new regex will only return one level of folders and takes the rest of the string to be the name; is that right? For example, a/b/c is a and b/c.

I think the general problem is that if / is in the name of an entry and the separator between folders, it's impossible for the regex to correctly parse it.

@sofurs

sofurs commented Jul 15, 2025

Copy link
Copy Markdown
Author

Hey, thank you for a quick reply.

Yes that's right. I did a quick research and found out that Bitwarden supports nested folders, thus I can incorporate nested folders to my naming scheme and change overall structure of entries. It's a pity that Bitwarden client nor browser extension do not allow for creation of nested folders directly, only by using / when creating new folder with the parent name preceding slash.

@fdw

fdw commented Jul 15, 2025

Copy link
Copy Markdown
Owner

Yeah, the UI could be more intuitive and comfortable 😕

But what do we do about the PR? If you still want to include slashes in the name, maybe the folder separator could be configurable? But that's also a lot of complexity....

@sofurs

sofurs commented Jul 15, 2025

Copy link
Copy Markdown
Author

I think we should close the PR, because now the functionality doesn't make sense. As you said, adding configurable separators would add unnecessary complexity and I think it would be confusing.

I have a few ideas on how to handle this edge case:

  • disclaimer in README, that entry names with slashes are not supported due to collisions with folder separator and how text selectors work, recommend using nested folders instead
  • somehow warn user, that entry names contain slashes when individual items for the selector are built

@fdw

fdw commented Jul 16, 2025

Copy link
Copy Markdown
Owner

I'm not sure about adding a line to the readme - you're the first person to run into this issue, so it doesn't seem that common to me. I think I'll wait until at least one more user chimes in that would find the hint helpful.

In any case, thanks for your effort and I hope you like rofi-rbw!

@fdw fdw closed this Jul 16, 2025
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

Successfully merging this pull request may close these issues.

2 participants