oh-my-fish / plugin-jump

A port of Jeroen Janssens’ “jump” utility.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`marks` command doesn't print the link destination correctly

garyp opened this issue · comments

The jump goes to the correct place, but the marks command just prints out the location of the mark file rather than the mark destination:

~ » marks
downloads           ->  /Users/gary/.marks/downloads
» command ls -ld $MARKPATH/downloads
lrwx------  1 gary  staff  21 Mar 29 17:06 /Users/gary/.marks/downloads -> /Users/gary/Downloads
~ » jump downloads
~/Downloads » pwd
/Users/gary/Downloads

This is on macOS 10.14.5 with fish 3.0.2.

commented

The behavior of pwd seems to have changed between fish v2 and v3. The pwd command has two options: -L for logical path and -P for physical path. In fish 2.7.1 such as found on Ubuntu 18.04 LTS it defaults to -P (same as /bin/pwd) but in fish 3.x it defaults to -L. An easy fix would be to change line 21 to read
set -l real_path (pwd -P)

The realpath function requires an argument in fish 3.1.0 and older. It seems to have been fixed in 3.1.2 so that it uses current directory if none is specified. But that could present a problem for backwards compatibility (Ubuntu 18.04 LTS is supported until 2023, I think, so fish v2.x will be out there for awhile yet).

commented

Just noticed that in fish 2.7.1 pwd doesn't take any args and throws an error if you pass the -P flag. Do we have to check the fish version before using the pwd builtin?