Skip to content

with the change to status -f output a realpath implementation would be useful #2932

@terlar

Description

@terlar

If you are symlinking scripts that rely on status -f being resolved to the original source, you will get the wrong file. Is this the correct behaviour of status -f and if so, is there a way to get the real path of the currently executed script?

Reproduction Steps:

  1. mkdir -p /tmp/dir1
  2. mkdir -p /tmp/dir2
  3. echo 'status -f' > /tmp/dir1/real.fish
  4. ln -s /tmp/dir1/real.fish /tmp/dir2/link.fish

Expected behavior:

$ fish /tmp/dir1/real.fish
/tmp/dir1/real.fish
$ fish /tmp/dir2/link.fish
/tmp/dir1/real.fish

Observed behavior:

$ fish /tmp/dir1/real.fish
/tmp/dir1/real.fish
$ fish /tmp/dir2/link.fish
/tmp/dir2/link.fish

Fish version: 2.2.0-747-ge395a0e

Operating system: Arch Linux, fish installed through AUR

Terminal or terminal emulator: termite

Metadata

Metadata

Assignees

Labels

enhancementrelease notesSomething that is or should be mentioned in the release notes

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