fish_config doesn't work in fish.app #3140

Closed
zanchey opened this Issue Jun 14, 2016 · 5 comments

Projects

None yet

3 participants

@zanchey
Member
zanchey commented Jun 14, 2016 edited

The fish 2.3.0 OS X application (fish.app) doesn't correctly support fish_config.

> fish_config
The __fish_bin_dir environment variable is not set. Looking in $PATH...
fish could not be found. Is fish installed correctly?

(It works if you have fish installed with Homebrew or the installer, which is probably why we haven't noticed in the past!)


For 2.3.1 release:

  • Mention fix in release notes
@zanchey zanchey added this to the 2.3.1 milestone Jun 14, 2016
@floam
Member
floam commented Jun 14, 2016 edited

I get the __fish_bin_dir error but it does launch the web browser and work.

@floam
Member
floam commented Jun 14, 2016 edited

I noticed what looks to be an issue with spaces in the fish.app name (after downloading it a second time, I had a "fish 2.app":

2.app/Contents/Resources/base/share/fish/tools/web_config/webconfig.py: No such file or directory
$ 
@ridiculousfish ridiculousfish self-assigned this Jun 14, 2016
@floam floam added a commit that referenced this issue Jun 14, 2016
@floam floam Quote `eval ... webconfig.py` in fish_config.fish
This was causing issues launching fish_config on OS X if fish.app is
renamed to contain a space (noted, but likely not the actual problem,
in issue #3140)
ab1db7e
@floam floam added the bug label Jun 18, 2016
@floam
Member
floam commented Jun 25, 2016 edited

#3170 was a hint. In https://github.com/fish-shell/fish-shell/blob/master/src/fish.cpp#L125 we expect the path of the fish binary to have a suffix of Contents/MacOS/fish - it fails completely as I could see after tossing in a debug statement printing exec_path and the paths members shortly after they are set.

→ exec '/Users/floam/Library/Developer/Xcode/DerivedData/Build/Products/Debug/fish.app/Contents/Resources/base/bin/fish'
<3> fish: exec_path is /Users/floam/Library/Developer/Xcode/DerivedData/Build/Products/Debug/fish.app/Contents/Resources/base/bin/fish
<3> fish: paths.data is /
<3> fish: paths.sysconf is /
<3> fish: paths.doc is /
<3> fish: paths.bin is /

The paths.doc and paths.bin dirs get nuked lower down when they do not represent an existing file after appending / with /share/fish, etc: https://github.com/fish-shell/fish-shell/blob/master/src/fish.cpp#L170-L187

As you can see the binary is not in is not Contents/MacOS in the bundle -- double clicking the app causes the exec seen above. it's simply in the wrong place. Resources/base/bin/fish - that is where xcode is configured to copy it right now. That is an inappropriate spot for this executable, it belongs in MacOS alongside fish_launcher. I'm fixing it.

@floam floam self-assigned this Jun 25, 2016
@floam floam added a commit to floam/fish-shell that referenced this issue Jun 25, 2016
@floam floam WIP fix for fish.app path issues (OS X)
Fixes Issue #3140 (not yet)

Move the fish binary to correct Contents/MacOS as referneced in the mistaken
fish.cpp. Update xcode project and dependencies, treating `fish` as a
standard altenrate executable.
b8091c0
@floam
Member
floam commented Jul 1, 2016

Might have fixed this one in 63120a9. Can someone test?

@floam
Member
floam commented Jul 1, 2016

It's fixed. 3d8e8a8

@floam floam closed this Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment