fr33zing / fr33zmenu

A multi-page fuzzy launcher for your terminal, written in Rust.
https://crates.io/crates/fr33zmenu
GNU General Public License v3.0
14 stars 1 forks source link

added cli only option to config #2

Open FantasyPvP opened 1 year ago

FantasyPvP commented 1 year ago

i've added an option in the submit function so that adding CLI-APP before the command to be executed in menu.toml will result in the command being executed in an environment where the app does work purely on the command line, in the original shell where the fr33zmenu command was run,

my implementation isnt the best, but it provides me personally with a fix to my biggest obstacle to using this project and integrating it into my linux desktop

image (adding the CLI-APP prefix lets the second command run as intended)

fr33zing commented 1 year ago

Thanks for the MR! This is a solid feature and definitely an oversight on my part for not testing this scenario. Also, apologies for letting it sit so long. I've been using my personal git server lately and haven't logged in here for quite a while. I have a couple nitpicks:

  1. Instead of changing selection to be mutable, I'd rather we just shadow it with a new mutable variable of the same name in the scope where it will be mutated.
  2. Instead of collecting keywords, it can be left as an iterator. After that, you can use take instead of getting the first keyword into cmd and then removing it from keywords
  3. This is really just a preference thing, but I prefer something other than CLI-APP as it's kind of confusing in my opinion. Someone might accidentally mistake it for the name of a command. I think we should use something like $ or maybe {shell}, what do you think?