-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: Add custom shell flag option for command execution #3726
Conversation
Thanks, but I'm not sure about this. Correct me if I'm wrong, but we can achieve the same thing by setting fzf2() (
export SHELL=/tmp/fzfsh
if ! [[ -x $SHELL ]]; then
echo '#!/bin/sh' > "$SHELL"
echo 'shift; echo "$@"' >> "$SHELL"
chmod +x "$SHELL"
fi
command fzf "$@"
)
fzf2 --preview 'run this command: {}' Having this option may save a few lines of code in some cases, but I'm afraid it will be a niche feature that few will use. |
The Windows situation is a bit messy now, and adding support for this might make it more complicated. Lines 41 to 63 in e86b81b
|
Your wrapper script is a simple and effective solution. No need for a new feature that few would utilize. |
Technically, this was just my guess, so I can't be 100% sure. But if I recall correctly, there hasn't been a feature request for this in the past years. But if you still like the idea, we can keep this PR open for a while and see what others think. IMO, if we're really going to add this, it should be easier to use than 1. setting two environment variables, 2. or creating a wrapper script. Something like |
I can't reopen the PR as the repo was deleted, but I will file an issue report. |
proposal
Ability to alter the flag that is passed to the
$SHELL
command.For example, if the
-c
flag could be altered to-e
, one could usejsc
(JavaScriptCore) to execute JavaScript code without addingjsc -e
to every line.Another example using
bun
and--print
.Pro:
line, which also diminishes the need for one round of quoting.
Con:
Issues
Windows
(not tested at all)