Skip to content

prompt_pwd -d1 -D3 fails for current directories that starts with dash  #10169

Closed

Description

@UgurcanAkkok

There is an error with the prompt_pwd.fish for directories that starts with a dash "-"

Fish version:

➜ fish --version
fish, version 3.6.4
➜ echo $version
3.6.4

Arch Linux, uname: Linux dell 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux

When i tried it with the given sh -c command, there was no failure for the prompt but when i manually call prompt_pwd -d1 -D3 it failes with the error below. The error is in https://github.com/fish-shell/fish-shell/blob/master/share/functions/prompt_pwd.fish this file.

To produce:

  1. cd into a directory that starts with a dash, for example: /tmp/tmp.nXGZLMSMrj/-a
  2. call prompt_pwd -d1 -D3

The error is:

string join: -a: unknown option

/usr/share/fish/functions/prompt_pwd.fish (line 48): 
            string join / (string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full
            ^
in function 'prompt_pwd' with arguments '-d1 -D3'

(Type 'help string' for related documentation)

Activity

  1. added
    bugSomething that's not working as intended
    on Dec 25, 2023
  2. added this to the fish 3.7.0 milestone on Dec 25, 2023
  3. UgurcanAkkok commented on Dec 25, 2023

    @UgurcanAkkok
    Author

    Thanks for the very quick fix!

  4. added a commit that references this issue on Dec 26, 2023
    6df2fac
  5. added a commit that references this issue on Dec 29, 2023
    e5d13fd
  6. added a commit that references this issue on Jan 27, 2024
    b1a1a3b
  7. locked as resolved and limited conversation to collaborators on Apr 6, 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

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions