batman@batman ~/D/S/rails> alias foo="cd ~/"
fish: Could not expand string '$tmp[2]'
/usr/local/share/fish/functions/alias.fish (line 19): set body $tmp[2]
^
in function 'alias',
called on standard input,
with parameter list 'foo=cd ~/'
Makes me wonder what else I'll have to relearn to use fish. Can someone tell me if it's worth the effort?
Edit: didn't take me long to find something worse. I defined my aliases as functions, but apparently fish executes all functions when it sources the file? By putting this function in:
(The usual way a fish user would add this function would be to put a file 'foo.fish' in ~/.config/fish/functions, or to use 'funced fish' to create one interactively.)
As for your infinite loop - fish certainly does not execute all functions when it sources the file. I wasn't able to reproduce your problem. Can you explain how you added this function?
That infinite loop thing is a bug for sure, it shouldn't do that! I have defined that type of function to jump to the directories of current projects - that should work.
function gogogo
cd ~/src/teh_project
end
funcsave gogogo
Then the "gogogo" function is available in all shells and loaded on startup - but not executed until I do so myself. From what I understand you wish to have the same functionality, and are doing the same thing, but are getting totally weird results.
Explicitly: No, it definitely shouldn't try to run functions right away. Bug!
FWIW I haven't tried the fishfish fork/update, just used the original version for a number of years.
It'd be greatly appreciated if you could spare a moment to send a bug report! (I'm not a dev by any means, just a fish lover ...)
Edit: didn't take me long to find something worse. I defined my aliases as functions, but apparently fish executes all functions when it sources the file? By putting this function in:
I was able to send fish into an infinite loop.