The activate.fish file currently generated by the virtualenv command use the 'source' command which does not exist in fish. This throws up an error on running the script. An easy solution is to change the source command to a '.'
See the attached images for details:
the original error
the edit I made to the activate.fish file
the result
The fish shell website tells differently.
https://fishshell.com/docs/current/commands.html#source
. (a single period) is an alias for the source command. The use of . is deprecated in favour of source, and . will be removed in a future version of fish.
Who am I to believe?
Sorry, I rushed to a conclusion after reading issue #211 on the fish shell page.
Apparently the same concern was raised in issue #310 and was addressed in the latest version of fish
The issue on my system was because apt-get only installs fish 2.0.0 by default and a separate repository needs to be added in order to get the version (2.2.0) in which the source
command was introduced. Adding the PPA repository fish-shell/release-2
and upgrading the fish package fixed the issue. Thanks so much for your help and sorry about the confusion.
Really? I am no fish version 2.3.1 and source of a virtualenv activate file does not work.
source ~/.venvs/base/bin/activate
Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.
~/.venvs/base/bin/activate (line 23): if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
^
from sourcing file ~/.venvs/base/bin/activate
called on standard input
source: Error while reading file '/Users/satkins/.venvs/base/bin/activate'
@sjatkins you are sourcing the activate
script, designed for bash / zsh / etc, instead of activate.fish
Most helpful comment
@sjatkins you are sourcing the
activate
script, designed for bash / zsh / etc, instead ofactivate.fish