-
Notifications
You must be signed in to change notification settings - Fork 513
Login switch not used #2384
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
Comments
@bgelens could you be more specific about what you have that works today and what you're expecting the integrated console to do?
Do you mean you've set
Do you mean that you want the Integrated Console to always start as a login shell by default if possible? Rather than allowing setting arguments like the suggestion above (which opens the door on a few issues, one being injection attacks), perhaps something like When you set a login shell in *nix, it actually never passes |
Looking at this more closely, there's no way for us to determine whether the login switch is available with a given PowerShell other than by starting it and checking the exit code, which is slow. It's simple to implement it to just add the |
Yes , configured via
No
Yes but just recently as I sometimes run into issues where I restart vs code using command palette where the environmental variables where not the same between sessions. I added this argument to the configuration to try and fix the IC as I thought it would inherit from the vs code default shell but I know now this is not the case. This is actually my issue, I have a lot of things installed using brew, I normally start vs code from a terminal and vs code inherits the environmental variables so everything works as expected. Starting vs code directly or using restart command breaks my flow :)
Yes or configurable using an option is fine as well for me. I'm not sure why the possibility for injection is a red flag considering the normal vs-code terminal already allows this. But as said, I don't mind an additional option so I can configure it myself. Thanks for the additional info on how startup shell actually works :) I had no idea. |
Ah! Do you know where you set those env vars? Running Makes me think we should work out some way to "source" env vars from bash/sh into the enclosing PowerShell process.
It would be alright as a user level setting I think, but not a workspace one -- that distinction is something VSCode has identified in their own configurations without huge explanation, but we usually try to follow it. That might be worth investigating more actually. It would probably work best as an extra configuration for an "addtional PowerShell exe", which we could then plumb through. |
I'm curious @bgelens, does the non-Integrated Console have the environment variables you expect? If that doesn't give you the typical environment variables you expect from a login shell, I don't know if we want to change the behavior of the Integrated Console. |
@rjmholt I don't have a .profile 🤷♂
It's more an inconvenience as a blocker for me as normally I launch everything from iterm2. Maybe nice for troubleshooting. printenv from ic using shortcut startup:
printenv from ic started from terminal (code .)
|
System Details
System Details Output
Issue Description
Depending if I open VS Code from a terminal
code .
or directly I have different paths in my $env:PATH variable.From terminal:
Directly:
The difference here is that my terminal session is using
-l
when starting pwsh (it's my login shell)Expected Behaviour
I would expect that Integrated Console would use
-l
when available or have an overwrite similar to:The text was updated successfully, but these errors were encountered: