Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ensure vim uses compatible shell in bootstrap #232

Merged
merged 1 commit into from

4 participants

@evidens

If you're using fish or some other shell, this will keep the install from failing.
Should have no adverse affects for most systems.

@evidens evidens Ensure vim uses compatible shell
If you're using fish or some other shell, this will keep the install from failing.
6ae291b
@jaywilliams

This won't solve the issue with some of the included bundles failing, while running vim after install. To fix that you'll need to set the term to /bin/sh in .vimrc

True, but that's an individual change in one's .vimrc.fork file. The above will ensure the install goes smoothly (after that they have to Google for the bit about set term=/bin/bash). Not sure how to safely test if it's not sh/bash compatible (in which case it could echo a message about adding that line to .vimrc.fork).

@johntyree
Collaborator

This is (possibly) about to become moot. See #230.

@evidens

As far as I understand it, regardless of which shell executes the install script, when running Vundle, the various installations will require shell interaction that assume a Bash-like shell.
Setting the SHELL variable to a known quantity avoids problems during the Bundle Install.
This is a separate issue from #230 having to do with reading from STDIN.

@johntyree
Collaborator

Yes, but to solve the bizarre problem of a single character being pushed into stdin, it's possible that the shell will need to be forced to sh or some other lowest-common-denomiator during install.

Still trying to figure it out, was just giving you a heads up.

@johntyree
Collaborator

Also, I was under the impression that the $SHELL variable was supposed to tell about the capabilities of the shell, changing it is not going to somehow make fish into a bash-compatible shell if it wasn't before, no?

I think it might be more appropriate to actually just run the install in sh instead of the current shell.

Does

sh -c "vim -u $endpath/.vimrc.bundles +BundleInstall! +BundleClean +qall"

work?

@evidens

The install script is already being run under sh. https://github.com/spf13/spf13-vim#linux-nix-mac-osx-installation

Changing $SHELL makes it so that shell commands invoked from within Vim use the specified program. (It's not enough that Vim is being invoked from sh).

In the case where .vimrc.fork doesn't have set shell=/bin/zsh (or other) this ensures all commands run in compatible mode.

Setting SHELL=/bin/sh is safe since the installation instructions already assume you are running the script under sh.

@johntyree
Collaborator

Ahh I see. I was mistaken about the semantics of the $SHELL. Yes, I agree. This is a totally reasonable thing to do.

@spf13 spf13 merged commit d1f5190 into spf13:3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 24, 2012
  1. @evidens

    Ensure vim uses compatible shell

    evidens authored
    If you're using fish or some other shell, this will keep the install from failing.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  bootstrap.sh
View
3  bootstrap.sh
@@ -50,4 +50,7 @@ if [ ! -e $HOME/.vim/bundle/vundle ]; then
fi
echo "update/install plugins using Vundle"
+system_shell=$SHELL
+export SHELL="/bin/sh"
vim -u $endpath/.vimrc.bundles +BundleInstall! +BundleClean +qall
+export SHELL=$system_shell
Something went wrong with that request. Please try again.