Repository navigation
Conversation
With use-fzf-default-opts yes, FZF_DEFAULT_OPTS is propagated into the popup env (upstream Aloxaf#509). If it contains --tmux or --popup, fzf opens a second (nested) popup inside the outer tmux popup -E, which flashes and closes, inserting the query text instead of showing matches. Strip --tmux/--popup (bare and =value forms) from the env value passed to fzf inside the popup. Keep --height/--layout and all other opts. Add 15 ztst cases covering bare/=value/mixed/separate-arg/empty inputs.
… match
zparseopts x:=_mesg stores ('-x' '<msg>') into the array; expanding it
unquoted after a literal -x passes two -x tokens. compadd binds the
literal '-x' as the message argument and inserts '<msg>' as a match
word, so zero-match groups with a message silently complete garbage.
Quoted index [2] gives compadd exactly one -x plus the message.
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.
Problem
In
-ftb-compadd, the-xmessage path mishandles howzparseoptsstores its result:zparseopts x:=_mesgappends both the option name and its value to the array, so$_mesgis('-x' '<msg>'). The unquoted expansion after the literal-xtherefore passes two-xtokens tocompadd: compadd binds the literal second-xas the message argument, and<msg>is left over as a match word.Reproduced with a minimal completer on zsh 5.9 (x86_64-linux):
Pressing Tab on
t <TAB>insertshello\ world\ msgonto the command line instead of displaying the message. So any zero-match group that carries an-xmessage silently completes garbage text instead of showing the message.Fix
Index into the array and quote it:
After the fix, the same minimal case displays
hello world msgas a message and inserts nothing.