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

VSCode terminal task not using zsh profile #143061

Closed
vikkrantxx7 opened this issue Feb 14, 2022 · 6 comments
Closed

VSCode terminal task not using zsh profile #143061

vikkrantxx7 opened this issue Feb 14, 2022 · 6 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@vikkrantxx7
Copy link

I'm trying to run a task on window load in VSCode where a terminal opens and nvm use is run by default. However, running this shell task seems to not load my zsh profile.

The output I get from running my task is:

zsh:1: command not found: nvm
The terminal process "/bin/zsh '--login', '-c', 'nvm use'"

When I run the terminal directly it is working as expected.
I have this set in settings.json-
"terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-l"] } }

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.64.2
  • OS Version: MacOS Big Sur 11.6.3
@meganrogge
Copy link
Contributor

Can you provide your task configuration?

@meganrogge meganrogge added the info-needed Issue requires more information from poster label Feb 15, 2022
@vikkrantxx7
Copy link
Author

"version": "2.0.0",
	"tasks": [
		{
			"label": "Change node",
			"type": "shell",
			"command": "nvm use 14.17.1",
			"group": "build",
			"detail": "version 14.17.1"
		}]

Running nvm use 14.17.1 directly on vscode terminal works and everything in .zshrc is included.
But when I run it through task somehow .zshrc is not included.

@meganrogge meganrogge removed the info-needed Issue requires more information from poster label Feb 16, 2022
@alexr00
Copy link
Member

alexr00 commented Feb 17, 2022

@vikkrantxx7 tasks are run as non-interactive, non-login shells (rc files will not be included) but we copy the environment from your VS Code process into your task shell. We often see issues with nvm because of how it handles setup though.

You can try adding -i to your arguments to see if making it an interactive shell works.

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Feb 17, 2022
@vikkrantxx7
Copy link
Author

Still the same
image

@alexr00
Copy link
Member

alexr00 commented Feb 17, 2022

You would need to add it in your setting:

"terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } }

@vikkrantxx7
Copy link
Author

You would need to add it in your setting:

"terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } }

This worked !! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants