edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.2k stars 70 forks source link

set: Tried to change the read-only variable “_” #65

Closed mattbishop closed 5 years ago

mattbishop commented 5 years ago

I'm getting this error when I run bass from config.fish using fish 3.0.0, Mac OS X 10.13.6's Terminal:

set: Tried to change the read-only variable “_”

In config.fish: bass source ~/.profile

in .profile:

export MAVEN_HOME=/Library/Maven/Home
export M2_HOME=$MAVEN_HOME
export TOMCAT_HOME=/Library/Tomcat/Home
#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
export JAVA_HOME=$(/usr/libexec/java_home)
export JRE_HOME=$JAVA_HOME

PATH=$MAVEN_HOME/bin:~/bin:$PATH

# MacPorts Installer addition on 2016-01-09_at_17:31:59: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.

Python:

python -V
Python 2.7.10
edc commented 5 years ago

Can you run bass -d source ~/.profile and see if you can reproduce it in debug mode?

mattbishop commented 5 years ago

I get this:

set: Tried to change the read-only variable “_”
# adding MAVEN_HOME=/Library/Maven/Home
set -g -x MAVEN_HOME "/Library/Maven/Home"
# updating PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin -> /opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:/Library/Maven/Home/bin:/Users/matt/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin
set -g -x PATH "/opt/local/libexec/gnubin" "/opt/local/bin" "/opt/local/sbin" "/Library/Maven/Home/bin" "/Users/matt/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/usr/local/bin" "/usr/local/git/bin" "/usr/local/MacGPG2/bin"
# updating _=/usr/bin/python -> /opt/local/bin/python
set -g -x _ "/opt/local/bin/python"
# adding M2_HOME=/Library/Maven/Home
set -g -x M2_HOME "/Library/Maven/Home"
# adding JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
set -g -x JAVA_HOME "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"
# adding TOMCAT_HOME=/Library/Tomcat/Home
set -g -x TOMCAT_HOME "/Library/Tomcat/Home"
# adding GRADLE_HOME=/opt/local/share/java/gradle
set -g -x GRADLE_HOME "/opt/local/share/java/gradle"
# adding JRE_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
set -g -x JRE_HOME "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"
edc commented 5 years ago

@mattbishop Thanks for the update. The culprit is this:

# updating _=/usr/bin/python -> /opt/local/bin/python

So in your bash set up, _ is aliased to launching Python. If you remove that, it will fix the problem.

mattbishop commented 5 years ago

Thanks Ed.