-
-
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
[FEATURE] Dynamic evaluation for change-prompt action #2299
Comments
That won't work. Once the child process terminates, the environment variables set in the process are lost. sh -c 'FOO=1'
echo $FOO
# Nope Have you considered using |
I wasn't aware of |
I'm looking for the same feature -- dynamic prompt evaluation. Specifically, I'm trying to emulate something like the "search engine" feature in Firefox and Chrome so that if the user types a specific trigger, it changes the prompt to indicate a particular "search engine" is active. So maybe I type and then
(I realize this won't quite work in my case since I'll have to also delete the |
man fzf
)Info
Background
Lets say I have a script that runs similar to something like
rofi
with custommodi
, where I can do something likefzf ... --bind 'ctrl-l:reload(menu -n),ctrl-h:reload(menu -p)'
, wheremenu
is just a wrapper to track state and reload what is provided forfzf
to filter on. I can start with a list of:then press
ctrl-l
, and I would be shown the next list of:which is amazing, and
fzf
is a wonderful tool to do this with. However, things become a bit more difficult when two of these lists are similar, but not the same, and hence I'm not really sure what I'm looking at.Request
Update the
change-prompt
action, or perhaps add a different one likechange-prompt-eval
, which will evaluate the command inside of the action call, and use that as the prompt forfzf
. Then, my above script would change to callfzf
likefzf ... --bind 'ctrl-l:reload(menu -n)+change-prompt-eval(echo $MENU_PROMPT),ctrl-h:reload(menu -p)+change-prompt-eval(echo $MENU_PROMPT)
. The value of the environment variableMENU_PROMPT
would be updated during the previousreload
call tomenu -n
ormenu -p
.Excuse me if I am missing functionality here, but as far as I understand it, I could do something like
fzf ... --bind 'ctrl-l:reload(find . -type f):change-prompt(Files> ),ctrl-h:reload(find . -type d):change-prompt(Directories> )'
, given that there are only a few modes with their own distinct bindings. However, the set of modes in this script is theoretically infinite, so just like I can dynamically generate the next state, I'd like to be able to dynamically generate the next prompt as well.The end result would leave us with something like:
and
and would allow me to clearly discern that I have a dog as a pet, not milk and cheese.
The text was updated successfully, but these errors were encountered: