-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make setting PS1 optional in pythonTerminalEnvVarActivation experiment #21959
Comments
I actually found the following code in the if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1-}"
if [ "xstudio-py3.9" != x ] ; then
PS1="(studio-py3.9) ${PS1-}"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
fi
export PS1
fi I figured that I guess that VS Code simply also has to respect this env variable and not modify |
We use
I assume this happens in one of the shell initialization scripts (
|
@karrtikr I guess the extra prompt wasn't showing up before as
|
Yep, so the script had the context of Unfortunately it has to be done system wide in order for all of VS Code to pick it up, so none of the terminal profile specific scripts would help. Try this answer: https://stackoverflow.com/a/588442, make sure to reboot system after setting var. |
@karrtikr TBH this sounds quite excessive. I got quite excited about this experiment as the command injection often interfered with other scripts like |
Another option could be to launch VS Code via Other than that, manually configuring |
With microsoft/vscode#145234 we're hoping to have the context of terminal variables as well, which is when this issue should go away automatically 🙂 Closing as limitation for now. |
@karrtikr Okay. I'll keep an eye on that other ticket then and try to work around it for now. |
Thanks! Appreciate the early feedback |
@levrik FYI in pre-release version of extension, adding the following
should also work. |
Thanks for the hint. This actually works. After checking the output of the It sets When putting an |
Oh, that's interesting. I'm wondering that maybe exporting a variable sets it for the system? Will look into it. (Thanks for the hint 😉) |
My prompt already includes the activated virtual environment, so it would be great if setting
PS1
could be made optional.The text was updated successfully, but these errors were encountered: