Skip to content

Ensure vim uses compatible shell in bootstrap #232

Merged
merged 1 commit into from Jan 1, 2013

4 participants

@evidens
evidens commented Nov 24, 2012

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
evidens commented Dec 7, 2012

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
evidens commented Dec 11, 2012

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 Jan 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.