Fix: Consistent fzf-tmux Handling and Option Passing #173
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>+o
a 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.sh
to 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.tmux
are not passed to thesessionx.sh
script. 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-tmux
vs.fzf --tmux
calls. Instead of setting size parameters insessionx.tmux
, the size parameters and thefzf-builtin-tmux
setting are now passed through tosessionx.sh
viaextra_options
array. Thesessionx.sh
script then uses these options to correctly execute eitherfzf
with the--tmux
parameter orfzf-tmux
with the-p
Fixes:
Resolves inconsistencies in how the user can configure sessionx to plain
fzf
in tmux rather thanfzf-tmux
. This provides more flexibility better handles scenarios where older versions of fzf are present.