Skip to content

Path resolving broken since 4.x when sourcing script #11423

Closed

Description

@bastimeyer

System env

$ fish --version
fish, version 4.0.2

$ lsb_release -as
n/a Arch "Arch Linux" rolling n/a

$ echo $KONSOLE_VERSION
250400

The issue is not related to any third-party stuff (does also occur in a clean environment).

Issue

Since 4.x, FISH doesn't resolve paths anymore when pressing TAB if it's a partially completed path and one of the parent directories (non-leaf-nodes) needs to be resolved/expanded. On 3.x, this worked perfectly fine.

This does not happen on all inputs, depending on the command/executable that receives the path as one of its arguments. It's possible that more than just source is affected by this, but completions of partial paths for ls or git add work fine for example.

source

Input (cursor at █, pressing TAB)
source ~/.config/f█/config.fish
source ~/.config/█sh/config.fish

Expected
source ~/.config/fish/config.fish█

Result
source ~/.config/f█/config.fish
source ~/.config/█sh/config.fish

ls

Input
ls ~/.config/f█/config.fish
ls ~/.config/█sh/config.fish

Expected
ls ~/.config/fish/config.fish█

Result
ls ~/.config/fish/config.fish█

Example

I have organized a couple of Python virtual environments in a single directory ~/venv/. Those venvs need to be activated by sourcing their respective activation script that can be found in each venv's bin/activate.fish sub-path.

$ ls ~/venv/{foo,bar}/bin/activate.fish 
/home/basti/venv/foo/bin/activate.fish  /home/basti/venv/bar/bin/activate.fish

Let's say I want to activate venv foo. I simply run source ~/venv/foo/bin/activate.fish from my command history. But now, if I instead want to activate venv bar and I don't have it in my shell's command history, without typing the command manually, the natural way to source the script is getting the command of the foo venv from the command history and modifying its path before executing the command.

So if I now move the cursor to the foo part of the path, remove it, and then type b (source ~/venv/b█/bin/activate.fish), pressing TAB now doesn't resolve the expected ~/venv/bar/bin/activate.fish path, like it did before on FISH 3.x.

Activity

  1. self-assigned this
    on Apr 24, 2025
  2. added this to the fish 4.0.3 milestone on Apr 24, 2025
  3. bastimeyer commented on Apr 24, 2025

    @bastimeyer
    Author

    Thanks for the quick fix. Appreciated...

  4. added a commit that references this issue on Apr 24, 2025
    97641c7
  5. added a commit that references this issue on May 12, 2025
    db32334
  6. locked as resolved and limited conversation to collaborators on May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions