Skip to content

Feature: support arguments containing whitespace without needing to escape the quotes #20

@benelan

Description

@benelan

Description

Currently all quotes in the arguments passed to gh fzf need to be escaped. For example, with gh, you can do:

gh issue list -S 'label:"known issue" milestone:"back burner"'

However, you need to escape the quotes to view that list with gh fzf, which shouldn't be a requirement:

gh fzf issue -S \'label:\"known issue\" milestone:\"back burner\"\'

This limitation is mentioned in the README's usage section, or else it would be a bug instead of an enhancement.

Acceptance Criteria

Arguments can be passed to gh fzf in the same format they are passed to gh, e.g. without escaping quotes.

Relevant Info

The quotes need to be escaped because the arguments are saved in the FZF_DEFAULT_COMMAND environment variable, which is how the list reloading and filtering works. This follows an example from fzf's readme.

I attempted to escape the quotes with printf:

escape() { printf "%q" "$@"; }

This worked for simple use cases, but not ones where quotes are nested like the example in the description.

This is a shell quirk, so I will probably need to do a golang rewrite to fix the issue.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions