Skip to content

pushd, pushd +2 behavior #1944

Closed
Closed

Description

@newhook

Unlike bash, zsh and other shells an argumentless pushd adds my home directory to the stack. Thats really irritating for people like me who have been using bash-like shells for 20+ years. Any chance this could be fixed to work like bash?

Activity

  1. ridiculousfish commented on Feb 11, 2015

    @ridiculousfish
    Member

    I'm not a pushd user so I don't know what behavior you expect, but I'll be happy to merge a pull request. The functions are in share/functions/pushd.fish and share/functions/popd.fish

  2. added this to the fish-future milestone on Feb 11, 2015
  3. zanchey commented on Feb 13, 2015

    @zanchey
    Member

    OK, so the desired behaviour is something like

    (bash)

    [~] $ popd
    bash: popd: directory stack empty
    [~] $ cd /etc
    [/etc] $ pushd /var
    /var /etc
    [/var] $ pushd
    /etc /var
    [/etc] $

    whereas fish currently does this:

    [~] > popd
    popd: Directory stack is empty...
    [~] > cd /etc
    [/etc] > pushd /var
    [/var] > dirs
    /var  /etc
    [/var] > pushd
    [~] > dirs
    /home/zanchey  /var  /etc
    [~] >
  4. newhook commented on Feb 13, 2015

    @newhook
    Author

    I have a script which does more or less the right thing. It doesn't handle pushd -2 yet (although I never use that myself). I'll issue a pull request at some point soon.

  5. eush77 commented on Jun 22, 2015

    @eush77
    Contributor

    Is there any progress on this issue?

  6. modified the milestones: , fish-future on Jul 31, 2015
  7. zanchey commented on Jul 31, 2015

    @zanchey
    Member

    This got added in #2173, although nobody has written the documentation yet.

  8. locked as resolved and limited conversation to collaborators on Apr 18, 2020
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions