postmodern / chruby

Changes the current Ruby
MIT License
2.88k stars 189 forks source link

SHELL env var assumes bash syntax #284

Closed JoshCheek closed 9 years ago

JoshCheek commented 10 years ago

I use fish, but never set my SHELL env var before. Recently had to do this to use an editor plugin.

But it breaks chruby here because the && is not valid fish syntax, fish uses the and command.


I played around with it a bit, trying things like this:

command="source /usr/local/opt/chruby/share/chruby/chruby.sh; chruby $argv && $SHELL $*"

if [[ -t 0 ]]; then exec "/bin/bash" -i -l -c "$command"
else                exec "/bin/bash"    -l -c "$command"
fi

But never actually got it working. In the end, I just overrode SHELL for the command that invokes chruby, but that wouldn't work if it needed to both invoke Ruby and start a shell.

havenwood commented 10 years ago

Checkout the chruby-fish wrapper for fish support.

JoshCheek commented 10 years ago

I don't see a fish-specific chruby-exec in there. I've been using that lib, and when I do type chruby-exec, it tells me the one from here.

postmodern commented 9 years ago

Since fish is not POSIX compliant, we can't really support it, let alone dash or ksh.