GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Incorrect handling of quoted & escaped parameters for Fish completions · Issue #2995 · pallets/click

Incorrect handling of quoted & escaped parameters for Fish completions #2995

New issue
Copy link
New issue
Copy link
Closed
#3013
Closed
Incorrect handling of quoted & escaped parameters for Fish completions#2995
#3013
Copy link
Labels
shell completionShell tab completion
Milestone
8.3.0

Description

@HansLehnert
HansLehnert
opened on Jul 5, 2025
Issue body actions

Completions for parameters in quotes, partially quoted or with escaped characters (e.g. whitespace) don't work properly for Fish shell.

I believe the issue is that for fish completion, the incomplete paramater is passed through the COMP_CWORD environment variable and it's expected that it will be contained in COMP_WORDS as the last parameter. However, before doing this match COMP_WORDS is parsed, which quotes and unescapes the parameters, while COMP_CWORD is not causing the match to fail. See code here.

How to replicate

Consider the following command

@click.command()
@click.argument('bar', type=click.Choice(('hello world',)))
def main(bar: str):
    pass

Trying to complete foo hello in Fish will correctly return completion for foo hello\ world.

The following incomplete commands will not return any completions

  • foo hello\
  • foo "hello
  • foo "hello"

Environment:

  • Python version: 3.13.5
  • Click version: 8.2.1

Activity

  1. Rowlando13 commented on Jul 6, 2025

    @Rowlando13
    Rowlando13
    on Jul 6, 2025
    Member
    More actions

    @HansLehnert I assume you meant Python 3.13.5?

  2. HansLehnert commented on Jul 6, 2025

    @HansLehnert
    HansLehnert
    on Jul 6, 2025
    ContributorAuthor
    More actions

    @HansLehnert I assume you meant Python 3.13.5?

    yes, thanks

  3. AndreasBackx
    closed this as completedon Aug 9, 2025
  4. kdeldycke
    added this to the This milestone has been deleted milestone on Aug 12, 2025
  5. Rowlando13
    modified the milestones: This milestone has been deleted, 8.3.0 on Aug 24, 2025
  6. github-actions
    locked as resolved and limited conversation to collaborators on Sep 8, 2025
  7. kdeldycke
    added
    shell completionShell tab completion
    on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    shell completionShell tab completion

    Type

    No type

    Projects

    No projects

      Milestone

      • 8.3.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.