Bash-it / bash-it

A community Bash framework.
MIT License
14.23k stars 2.29k forks source link

protocol error: unexpected <newline> #535

Closed norbertosoriano closed 8 years ago

norbertosoriano commented 9 years ago

When trying to copy (using scp) a file from A (has bash-it installed) to B, I get an error:

protocol error: unexpected

Tracing back the error, there seems to be problems with some plugins that print out (echo) information which ssh protocol considers as not valid.

E.g. NVM plugin prints out "echo NA".

nwinkler commented 9 years ago

Seems to be similar to #530 - can you check the solution described there (disable all plugins, then enable only the ones you really need or have installed)?

nwinkler commented 9 years ago

Looking at the nvm plugin - it seems like it's a really old version of https://github.com/creationix/nvm. I'm not sure why we're keeping a copy of this in the repo...

@tswicegood @edubxb - what's your opinion on this? Same as for the fasd plugin - do we want to keep copies of these tools in Bash-it? It sounds like a maintenance nightmare to me - we will never be able to keep up with updates...

nwinkler commented 9 years ago

On OS X, I can install nvm using brew install nvm - I prefer this to having an outdated version here... It then tells me to do the following, which might be difficult to capture in a Bash-it plugin:

source $(brew --prefix nvm)/nvm.sh
norbertosoriano commented 9 years ago

@nwinkler thank you for your comments. So, I've disabled all plugins and enabled only those ones needed, and by this I've managed to have a stable environment, but I don't think this should be the approach taken in order to have a stable bash-it environment.

nwinkler commented 9 years ago

Sure, I completely agree. I guess you selected the all option during the installation, right? This will enable everything, and we have seen that this is causing many issues for some people.

I'm in the process of updating the install script to use a sane default of plugins to minimize the risk of causing issues. This will hopefully streamline things...

edubxb commented 9 years ago

@nwinkler I agree with you, probably is a bad idea trying to maintain plugins that really are tools maintained with other people and "inlcuded as is" in Bash it.

Removing these "plugins" could be the best option.

tswicegood commented 8 years ago

Just catching up on an old thread (via #611). If we start removing things like this, let's change it to include output when its sourced explaining that it's been removed and how to disable the warning.

nwinkler commented 8 years ago

:+1:

To be really useful, the nvm plugin should only do the following, which is to load the local nvm installation:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

I agree, to keep things compatible, maybe we should check for the presence of the nvm command in this case, and if it can't be found, we create a simple function which just prints a message saying that you should install it using the documented nvm install instructions. This way, people would be aware of the change.

I'll take a stab at implementing this for the nvm plugin...

nwinkler commented 8 years ago

I've given this a try in #612 - please feel free to take a look, @tswicegood @edubxb

Not sure if the wording is the best, but the general idea should be clear.