Skip to content

fish completions error - command substitutions not allowed in command position #2503

@StefanLobbenmeierObjego

Description

Describe the bug
A clear and concise description of what the bug is.

Note that any how to questions should be posted in the discussion board and not raised as an issue.

Version of yq: 4.48.1
Operating system: macOS 26.0.1 (25A362)
Installed via: homebrew

Input Yaml
Irrelevant

Command

This is the real command that I found it with:

yq eval '.items[] | select(.kind == "Secret" and .type == "Opaque") | .metadata.name' ~/objego/

and then press the tab key

It seems to occur whenever there is a pipe involved:

yq eval '.items[] | ' ~/foo

Actual behavior

As text:

yq eval '.items[] | select(.kind == "Secret" and .type == "Opaque") | .metadata.name' ~/objego//opt/homebrew/share/fish/vendor_completions.d/yq.fish (line 1): command substitutions not allowed in command position. Try var=(your-cmd) $var ...
YQ_ACTIVE_HELP=0 yq __complete eval .items[] | select(.kind == "Secret" and .type == "Opaque") | .metadata.name '~/objego/'
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in command substitution
	called on line 25 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_perform_completion'
	called on line 1 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in command substitution
	called on line 67 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_perform_completion_once'
	called on line 89 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_requires_order_preservation'
in command substitution
/opt/homebrew/share/fish/vendor_completions.d/yq.fish (line 1): command substitutions not allowed in command position. Try var=(your-cmd) $var ...
YQ_ACTIVE_HELP=0 yq __complete eval .items[] | select(.kind == "Secret" and .type == "Opaque") | .metadata.name '~/objego/'
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in command substitution
	called on line 25 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_perform_completion'
	called on line 1 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in command substitution
	called on line 67 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_perform_completion_once'
	called on line 89 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_requires_order_preservation'
in command substitution
/opt/homebrew/share/fish/vendor_completions.d/yq.fish (line 1): command substitutions not allowed in command position. Try var=(your-cmd) $var ...
YQ_ACTIVE_HELP=0 yq __complete eval .items[] | select(.kind == "Secret" and .type == "Opaque") | .metadata.name '~/objego/'
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
in command substitution
	called on line 25 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_perform_completion'
	called on line 1 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in command substitution
	called on line 67 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_perform_completion_once'
	called on line 122 of file /opt/homebrew/share/fish/vendor_completions.d/yq.fish
in function '__yq_prepare_completions'
in command substitution

As image:
Image

Expected behavior
Should list the files found in that folder

Additional context
I first assumed it was related to some fish plugin I have installed but I can even reproduce in a blank fish started via env HOME=/tmp/foo fish

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions