Fix: Consistent fzf-tmux Handling and Option Passing#173
Open
zyoNoob wants to merge 3 commits into
Open
Conversation
|
This is needed, is the plugin not maintained anymore? |
Author
|
Looks like it's still being maintained but only on life support mode. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Consistent fzf-tmux Handling and Option Passing
Problem
At present the plugin doesn't work properly with fzf installations that lack the fzf-tmux binary, and the fzf --tmux support is not working.
Replicating the problem
Environment
.config/tmux/tmux.conf
Expected Behavior
When the user presses the hotkey in a tmux session - in my case
<tmux-prefix>+oa tmux-sessionx window should openActual Behavior
Nothing happens, no tmux-sessionx window spawns and no errors get logged in tmux log file either.
How error was traced
modified
run_plugin()insessionx.shto print out the argsLog Output
Invoking the sessionx plugin via the hotkey defined in configuration file generated this output in the logfile -
Conclusion
As can be seen from above log, for some reason args set in the
sessionx.tmuxare not passed to thesessionx.shscript. This is a bug, and since my gripe was with how the fzf call was being handled, I have opened this PR to fix the issue. There may still be some issues with other args, not that I ran into them given this is my first time even using this plugin.This PR fixes the usage of args in the fzf calls.
Major Change:
Refactors the handling of
fzf-tmuxvs.fzf --tmuxcalls. Instead of setting size parameters insessionx.tmux, the size parameters and thefzf-builtin-tmuxsetting are now passed through tosessionx.shviaextra_optionsarray. Thesessionx.shscript then uses these options to correctly execute eitherfzfwith the--tmuxparameter orfzf-tmuxwith the-pFixes:
Resolves inconsistencies in how the user can configure sessionx to plain
fzfin tmux rather thanfzf-tmux. This provides more flexibility better handles scenarios where older versions of fzf are present.