Skip to content

python completions are wrong for the non-default interpreter #3840

@asomers

Description

@asomers
  • Have you checked if problem occurs with fish 2.5.0?
  • Tried fish without third-party customizations (check sh -c 'env HOME=$(mktemp -d) fish')?

fish version installed (fish --version):
fish, version 2.5.0-180-g0a929f7a-dirty

OS/terminal used:
FreeBSD 12.0, QTerminal

Commit f70b1ff simplified the Python completion code, but it introduced a new bug. On a system with a symlink from python to either python2 or python3, python.fish will use the completions for the default interpreter, regardless of which interpreter is invoked. The problem is that, unlike in the old code, the new python2.fish and python3.fish files don't pass the executable name to python.fish.

Reproduction steps

  1. Ensure that /usr/local/bin/python points to /usr/local/bin/python2
  2. Type "python3 -" and press tab
  3. Among the suggestions should be "-q", "-X", "-b", and "-bb". But none of those will be there. Instead you'll see "-3", "-t", and "-Q"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions