Skip to content

cd does not work if a directory starts with the character - #6071

Description

@bugnano

I'm using fish version 2.7.1 running on Fedora 29 x86_64.
Let's say for example that I create a directory like this:

mkdir -- -mydirectory

this creates a directory called -mydirectory (note that its name begins with the - character)

now I want to go to that directory.

If I try to run:

cd -mydirectory

it fails with:

cd: Unknown option '-mydirectory/'
/usr/share/fish/functions/cd.fish (line 30): 
    builtin cd $argv
    ^
in function 'cd'
	called on standard input
	with parameter list '-mydirectory/'

ok, let's try with:

cd -- -mydirectory

and it fails with the error:

Too many args for cd command

So I don't know any other method to cd to that directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions