Open ohadschn opened 6 years ago
The integrated console is always started with -NoProfile
because our custom host does the profile processing.
That profile processing step is probably skipped for temporary consoles though. Not sure if that was a design decision or something that fell threw the cracks. Either way, profile loading for temporary consoles should definitely be an option (and probably on by default)
Early on the extension didn't have a custom host and debug input/output happened via the Debug Console. I think we suppressed profiles back then. The addition of the "temporary console" was to attempt to bring back something like that debug experience where you started with a fresh & clean session every time. Debugging with persistent state can be very handy but also somewhat dangerous. You can fool yourself into thinking your script works when in fact, in a clean session it won't work.
While I can see having a setting to enable profile processing in the temp console, I personally don't think it should be the default. Relying (intentionally or unintentionally) on local state created by your profile, is not a recipe for success when that script is moved to another machine with a different profile configuration.
Hi,
I use temporary session because I write powershell Classes. But my prompt is often too long and I'd like to set it in the profile.
I sadly don't have code to contribute. Maybe if I could pass the prompt somehow in the vscode launch.json that would be great.
Thanks a lot!
System Details
Issue Description
The PowerShell terminal and the PowerShell Integrated Console both load PowerShell profiles. However, when setting
powershell.debugging.createTemporaryIntegratedConsole
to true, profiles are not loaded. Looking at process explorer, I believepowershell.exe
is being executed with-NoProfile
. This is undocumented, inconsistent, and IMO undesired.