Skip to content
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: set FZF_SELECTION env var containing text of selected item #3781

Closed
wants to merge 1 commit into from

Conversation

kuremu
Copy link
Contributor

@kuremu kuremu commented May 8, 2024

Sets FZF_SELECTION to the ansi-stripped text of the currently selected item in t.environ(), essentially inserting the value of {} into the environment. If there is nothing in the list, FZF_SELECTION is set to an empty string.

fzf --bind "focus:transform-prompt(echo \${FZF_SELECTION}\>\ )"

This would be useful to me as my reload/transform calls have become pretty complex, and I'm already capturing the other FZF env vars.

@junegunn
Copy link
Owner

I'm not sure about this (at least not yet). You can already do this with current={}; rest_of_the_command. And by doing this, we're pushing the current item to every child process, whether they need it or not. And in some cases, it can be quite lengthy (e.g. minified JS files, single line of hundreds of KBs), so it might cause some problems.

@kuremu
Copy link
Contributor Author

kuremu commented May 15, 2024

I see what you mean, no worries I'll close this for now

@kuremu kuremu closed this May 15, 2024
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.

None yet

2 participants