Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable tabtab #40

Open
tough-griff opened this issue May 22, 2018 · 7 comments
Open

Option to disable tabtab #40

tough-griff opened this issue May 22, 2018 · 7 comments
Assignees
Labels

Comments

@tough-griff
Copy link

Between using nodenv to manage multiple versions of node and npx to execute and install packages rather than global installations, tabtab has trouble managing the installation locations of packages and clutters my shell configuration by adding completions for scripts I may only run once or twice.

I would like the option to disable tabtab globally in some manner, for example a TABTAB_DISABLE environment variable or similar.

@mklabs
Copy link
Owner

mklabs commented May 29, 2018

Hi I understand your issue and will take a good look at it. This is indeed a genuine issue.

Thanks for your feedback. Meanwhile I would recommand uninstalling any tatab completion package you might have active on your system.

@tough-griff
Copy link
Author

Excellent, thanks!

I'd be happy to work on a PR, but a cursory glance at the code didn't give me a very good idea on where to implement such a check. If ya can point me in the right direction I can give it a shot!

@mklabs mklabs self-assigned this Jul 16, 2018
@mklabs mklabs added the bug label Jul 16, 2018
@Gerst20051
Copy link

Gerst20051 commented Jan 15, 2019

I don't understand why or how dependencies of packages I'm installing for a project can manage to modify my shell profiles. I'm requiring serverless in my projects and when I run npm i for the first time in one of the projects it updates either .<shell>rc such as .bashrc or .zshrc file (depending on the default shell). I would love if it didn't do that.

Here is the output from running npm i:

# [tabtab] Adding source line to load ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/serverless.zsh
# in ~/.zshrc

# [tabtab] Adding source line to load ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/sls.zsh
# in ~/.zshrc

# [tabtab] Adding source line to load ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/slss.zsh
in ~/.zshrc

Here is the content that was added to .zshrc:

# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/serverless.zsh ]] && . ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/sls.zsh ]] && . ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/sls.zsh
# tabtab source for slss package
# uninstall by removing these lines or running `tabtab uninstall slss`
[[ -f ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/slss.zsh ]] && . ~/Code/GitlabRepos/my-serverless-project/node_modules/tabtab/.completions/slss.zsh

@Gerst20051
Copy link

Gerst20051 commented Jan 15, 2019

This is similar to the following issues:

serverless/serverless#3792
serverless/serverless#4069
serverless/serverless#4672
serverless/serverless#5124

Here is a link to the postinstall script that calls tabtab:

https://github.com/serverless/serverless/blob/master/scripts/postinstall.js

Here is the commit that initially added calls to tabtab:

serverless/serverless@671049a

Here is a commit on a forked repo that removes the code that calls tabtab:

axelson/serverless@0e4ddf3

Here is a MR that removes the postinstall script from serverless:

serverless/serverless#5706

Here is a previous MR that fixed an issue calling tabtab:

https://github.com/serverless/serverless/pull/3870/files

Here is a workaround to "short circuit" installing tabtab:

ahawkins/dotfiles@bee5e3c

The slss autocompletion was added in this merge request:

serverless/serverless#4712

@jeffbski
Copy link

jeffbski commented Feb 27, 2019

Another issue is that this old version of tabtab ends up using dependencies that include an old version of spawn-sync that requires a binary compile. Doing npm rebuild with docker lambda causes a postinstall error from spawn-sync.

Node 8+ no longer needs this polyfill, so newer versions of tabtab do not need spawn-sync, so migrating that that would help.

However it would be nice to make this totally optional. I can't even get it to work as is now.

So make autocomplete a plugin and let people choose to install it only if they need/want it.

(I just realized this issue is in the tabtab repo, so I will post the suggestion in serverless repo)
Added comment to serverless/serverless#4069

@bsamuel-ui
Copy link

Workaround: leave the # tabtab source for X package lines in your .bashrc

@hraban
Copy link

hraban commented Dec 22, 2022

I wish there were some kind of global export NPM_DONT_TOUCH_MY_COMPUTER=noconsent var I could set, supported by all these "smart" tools. Between this, and tools like husky, running npm install on a project is a gamble in "what are well meaning overzealous developers going to break in my setup, this time?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants