Closed jhbruhn closed 3 years ago
Thanks! What bothers me a bit is that
readarray
and the array-based parameter expansion methods) would probably work a lot fastercommand
provider being present. Maybe this kind of fallback behaviour can/should actually be something hardcoded into the launcher (->as a mandatory provider that's always present).Side note: I've been wondering if it would be possible to use this approach as an alternative to inspecting the number of returned lines. But the way it's currently written requires us to pass the fzf
result into one of the available providers and I see no way to format the query in a compatible fashion using the tools provided by fzf.
I feel like this would really benefit from a little extra legwork, but I need to think it through for a bit...
An alternative to formatting the pseudo-query for the command-provider would be to add a plan-command provider which does not list anything and, if enabled, is only used as a fallback provider and then match the plain-text query. I will have a look as soon as I find the time to do so.
1ac6d76
Thank you for the discussion and putting putting in the work for this PR. I have implemented a solution that addresses the concerns in the above commit
Regarding #27, I implemented this first (dirty, see code) version of executing arbitrary commands. It works by parsing the output of fzf with --print-query enabled. If there is only one line (the query), it constructs a synthetic command-entry and launches that.
Please critique this code heavily as I am not a regular shell programmer.