Skip to content

$dirprev variable scope is not honored using cd #5797

@lucas-santoni

Description

@lucas-santoni

Using fish, version 3.0.2, on macOS Mojave 10.14.4.

I would like to share my cd / cdh history between fish instances.

Quoting man cdh:

Note that the cd command limits directory history to the 25 most recently visited
directories. The history is stored in the $dirprev and $dirnext variables which
this command manipulates. **If you make those universal variables your cd history is
shared among all fish instances.**

Taking a look at the share/functions/cd.fish file, we can see that the $dirprev variable is set at the global scope, shadowing the universal variable of the same name.

Maybe we can fix this by honoring $dirprev scope if its set universally? I opened #5796 to this effect.

Metadata

Metadata

Assignees

No one assigned

    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