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

Integrated console does not write output on Windows Insider build 16193 #742

Closed
yhvicey opened this issue May 14, 2017 · 31 comments
Closed

Comments

@yhvicey
Copy link

yhvicey commented May 14, 2017

System Details

  • Operating system name and version: Microsoft Windows [Version 10.0.16193.1001]
  • VS Code version: 1.12.1
  • PowerShell extension version: 1.0.0
  • Output from $PSVersionTable:

image

Issue Description

VSCode cannot launch integrated powershell and stuck at showing "starting powershell..." like this:

image

Attached Logs

log.zip

@jaapbrasser
Copy link

jaapbrasser commented May 15, 2017

I have the same issue on the 10.0.16193.1001 build and also on the previous Insider Fast Ring build. Does anyone know of a workaround for this issue?

Just realized killing the integrated PowerShell session and pressing CTRL + ` will open a powershell.exe session. This one does not get stuck at loading and seems to be a workaround until we get an insider build that doesn't have this issue.

@daviwil daviwil changed the title Get stuck at starting powershell Integrated console does not accept input on Windows Insider build 16193 May 15, 2017
@daviwil
Copy link
Contributor

daviwil commented May 15, 2017

I was able to repro the issue on Friday, looks like Windows broke the console APIs that I use to read input. I was trying to install a newer canary build to test with but it kept rolling back. I'll try again today to see if the latest builds fix the issue.

@daviwil
Copy link
Contributor

daviwil commented May 15, 2017

Just tried this with internal canary build 16199 and I'm still seeing the problem. I'll try to debug the issue and see where it's coming from.

/cc @bgelens @jdhitsolutions

@jaapbrasser
Copy link

Thanks for following up on this @daviwil, I appreciate that!

@mud5150
Copy link

mud5150 commented May 16, 2017

@jaapbrasser How are you killing the integrated console? Mine comes back whenever I try to debug. Having no luck trying to work around this issue.

@jaapbrasser
Copy link

jaapbrasser commented May 16, 2017

image

This is what I do, click this button and then hit CTRL + `

image

I do end up with this error message, so it is not a full workaround as this blocks me from seeing my open files.

@jdhitsolutions
Copy link

I still see this issue with VSCode 1.12.2

@daviwil
Copy link
Contributor

daviwil commented May 16, 2017

Updates to VS Code won't fix this unfortunately, it's an issue that manifests in PowerShell Editor Services.

@daviwil daviwil added this to the May 2017 milestone May 16, 2017
@daviwil
Copy link
Contributor

daviwil commented May 16, 2017

Workaround

OK folks, I've got a workaround for this issue. Open up your VS Code profile at one of the following paths (create the file if it doesn't already exist):

Windows PowerShell 5.1

$HOME\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1

PowerShell Core 6.0

$HOME\Documents\PowerShell\Microsoft.VSCode_profile.ps1

Insert this line at the top of the file:

[System.Console]::OutputEncoding = [System.Text.Encoding]::ASCII

Now restart VS Code. When the Integrated Console appears, you should start to see output again.

Explanation

Something happened in the latest Windows Insider builds to cause output in the Integrated Console to not be written inside of VS Code's integrated terminal. My guess is that there's some specific set of factors that contribute to this issue since it doesn't happen when you set powershell.exe to use UTF-8 output encoding inside of VS Code. I'll continue investigating this issue to try and find a real solution, but the workaround should suffice for now.

@mud5150
Copy link

mud5150 commented May 16, 2017

@daviwil Thanks man. That got me going.

@daviwil daviwil changed the title Integrated console does not accept input on Windows Insider build 16193 Integrated console does not write output on Windows Insider build 16193 May 16, 2017
@daviwil
Copy link
Contributor

daviwil commented May 16, 2017

Thanks for confirming, glad it helped!

@brwilkinson
Copy link

brwilkinson commented May 16, 2017

Thanks worked for me. . . well after I enabled the profile again.

"powershell.enableProfileLoading": true

Seems faster ;)

@jaapbrasser
Copy link

Also resolved it for me, you are a legend @daviwil, thanks for looking into this!

@Graham-Beer
Copy link

Thank you @daviwil, workaround worked a treat.

@DexterPOSH
Copy link

Aha! It works, now I can start moving away from the ConEmu 😄 .

@MaximoTrinidad
Copy link

@daviwil ! Thanks for the workaround. It work on both VS Code April release and in the latest VS Code Insider.

:)

@michelderooij
Copy link

Bit late to the party, but thanks for the workaround (y)

@ZodmanPerth
Copy link

Workaround doesn't help me at work because the script is blocked by group policy.
Will this be fixed in the next release?

@jaapbrasser
Copy link

Even without administrative right you can change your ExecutionPolicy on the system, if you run the following you should be fine:

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser

@daviwil
Copy link
Contributor

daviwil commented May 30, 2017

@ZodmanPerth not much I can personally do about it right now, this is an issue caused by changes to Windows' console implementation in the latest Insider builds. I'm still waiting for a fix on their side.

@daviwil
Copy link
Contributor

daviwil commented May 30, 2017

Actually, I could possibly do a temporary fix inside of the language server to change the thing I'm doing that's triggering Windows console's bug, let me look into it for this week's release.

@daviwil daviwil modified the milestones: May 2017, June 2017 Jun 1, 2017
@bgelens
Copy link

bgelens commented Jun 11, 2017

Wanted to provide an update on this from the end-user exp:

without workaround it still doesn't work on Windows build 16215 with vs code 1.13.0 and PS Ext 1.3.1

An update though which didn't work before. I am now able to get a descent working prompt again by first setting ASCII mode and after setting Unicode mode.
2017-06-09_20-50-05

No more question marks is worth a lot for me!

Note that I cannot go to Unicode directly for some reason.

@daviwil
Copy link
Contributor

daviwil commented Jun 11, 2017

Awesome, thanks Ben! So is the output fixed for the rest of the session after that? I might be able to just make that the fix internally.

@bgelens
Copy link

bgelens commented Jun 11, 2017

Yes, the rest of the session look normal now

@bgelens
Copy link

bgelens commented Jun 13, 2017

@daviwil I got some Chinese chars in the mix when doing stuff with git now.. maybe better to sit out Windows Insider builds until fixed!

@daviwil
Copy link
Contributor

daviwil commented Jun 13, 2017

Thanks for the update! I agree, seems like the console components are undergoing a lot of change at the moment so it might be best to avoid the latest Windows Insider builds.

@MaximoTrinidad
Copy link

Just an FYI

Still happening with PowerShell extension 1.3.2.

vscodeposhinter_2017-06-13_10-05-22

@Jaykul
Copy link

Jaykul commented Jul 15, 2017

Still a problem on 1.4.1 on Build 16237

image

@Jaykul
Copy link

Jaykul commented Jul 15, 2017

But it's fixed in 16241 👍
image

@bgelens
Copy link

bgelens commented Jul 15, 2017

Confirm fix 👍

@daviwil
Copy link
Contributor

daviwil commented Jul 15, 2017

That's excellent news, thanks a lot for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests