Skip to content

Fish completion fails when command line starts with a space #1303

@Luap99

Description

@Luap99

If the current command line starts with a space the completion fails. It will only provide file completion.

Note: This is valid syntax used to prevent the shell from writing the command to the history.

BASH_COMP_DEBUG_FILE output:

commandLine is:  podman 
Starting __podman_perform_completion with:  podman 
args:  podman 
last arg: 
Setting emptyArg
emptyArg: ""
Cannot find . No completions.
Completion results: 
No completion, probably due to a failure

I think this line causes the problem:

set args (string split -- " " "$argv")

We need to trim $argv before we can split on space

This bug was originally reported by @pastalian in containers/podman#8829

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions