-
Notifications
You must be signed in to change notification settings - Fork 500
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
Errors that occur when loading profile scripts aren't written to the console #689
Comments
We use a different profile for VS Code: |
So it never acknowledges this setting??
|
Sorry, my answer was too brief. Which specific profile script are you expecting it to load? My assumption was that you expect |
I expected it to load my profile.ps1 just as PowerShell.exe does. If it is not going to I will just disable that console because I have no reason to keep up with 2 copies of my profile. |
Which I guess is another issue to submit the ability to disable the integrated console. |
You can prevent the console from appearing on startup with this setting: |
Well I'd prefer to have the full PowerShell.exe as my terminal. Running modules and commands via the integrated console give different results compared to the same being done in PowerShell.exe. (e.g. |
If it's purely a matter of preference, that's totally understandable. However, I'd like to make the Integrated Console as compatible as I can. Could you briefly tell me what gaps you see? |
|
Keep an eye out for the custom types one and let me know if you see it again. That shouldn't be happening so I'd like to fix it if I'm causing it somehow. The cursor issues will be resolved in the very near future before we hit 1.0. They're pretty annoying! Thanks for the feedback! |
Ahhh, are you using Windows 10 Creators Update? There are some general issues with VS Code's integrated terminal in Creator's Update caused by some changes in the Windows console host. |
"Creators update"? Don't think so, I do not have Windows 10 set to the fast track or anything. I'm on Windows 10.0.14393. |
I'll take a look at this for the next update. |
I retract my comment. |
Hey Shawn, it turns out that errors that occur while loading your profile script aren't currently being written to the console. I can confirm that |
This change causes both errors and object output to be written to the host when profiles are being loaded. Users who had issues in their profile scripts thought that the scripts weren't being loaded when in fact there were errors not being displayed. Also, users using Write-Output in their profile scripts did not see that output. This change makes the PSES host consistent with the PowerShell ConsoleHost, writing both forms of output when loading profile scripts. Resolves PowerShell/vscode-powershell#689 Resolves PowerShell/vscode-powershell#663
This change causes both errors and object output to be written to the host when profiles are being loaded. Users who had issues in their profile scripts thought that the scripts weren't being loaded when in fact there were errors not being displayed. Also, users using Write-Output in their profile scripts did not see that output. This change makes the PSES host consistent with the PowerShell ConsoleHost, writing both forms of output when loading profile scripts. Resolves PowerShell/vscode-powershell#689 Resolves PowerShell/vscode-powershell#663
The problem is that this host is missing a lot of things that the normal console host has, like the color settings in $Host.PrivateData, so profiles that work fine in ConHost (or even ISE) don't necessarily work fine here. |
Yep, that's what I'm guessing. Getting the errors to display is the first step in figuring out what people are doing that isn't supported here yet. I'll see if I can get the PrivateData support added in the next release or two. |
My profile.ps1 has no errors in it. PowerShell.exe would show those if it did when loading it (outside of VS Code), and it loads cleanly. |
My exact profile on my local machine if you want something to test with... |
@wsmelton Just to be sure, check |
This is still an issue with my profile not loading into the integrated terminal. Is that going to be fixed or I just need to use the PowerShell.exe terminal? None of the functions I have in my main profile are being loaded. |
Do you see any errors written to the console when it loads? I have a high degree of certainty that there's an error in your profile script that prevents it from completing. |
Also check the |
None. It loads fine for PowerShell.exe terminal with no errors so can't be my profile. |
By the way, I noticed in an earlier comment that you pasted your |
Also, what's in your |
It just occurred to me after looking at your
. (Join-Path -Path (Split-Path $profile) -ChildPath Microsoft.PowerShell_profile.ps1) |
I'll just continue using PowerShell.exe terminal. I'm not going to keep up with 2 seperate profiles. |
Using my second recommendation, you won't have to. But do whatever you like :) |
Thanks! Redirecting the VSCode_profile to also load my Powershell_profile is exactly what I was looking for and works fine for me. One line of code to maintain. I prefer the separation so that if there are any debugging preferences that I want to add in the integrated profile, it doesn't affect my main shell. Nice! |
Hello, I'm still a bit confused. Was searching for couple of days to get better understanding how does the VSCode Powershell extension handles profiles and finally got to this thread. My understanding from the description of setting |
@cassta can you capture Verbose logs and attach them here? Instructions: https://github.com/PowerShell/vscode-powershell#2-capture-verbose-logs-and-send-them-to-us |
@daviwil, I'm sorry, my bad. Not sure why I didn't realize it earlier, but as I use by default 64-bit version of Powershell I simply missed that VSCode is "just" 32-bit application, therefore working with profiles in SYSWOW64. Once profile was replicated to expected location everything started to work fine. Sorry for any inconvenience caused. |
System Details
$PSVersionTable
:Issue Description
Running VS Code the initial terminal that is started for PowerShell showing as "1: PowerShell Integrated Console" does not load my user profile. This is with
powershell.enableProfileLoading
set to true.Although if I start a new terminal for PowerShell I can see that my profile does get loaded.
Attached Logs
Logs.zip
The text was updated successfully, but these errors were encountered: