2.0.0-insiders-834: prompt gets displayed in an endless loop
Issue Description
When I open a folder containing PowerShell scripts, the integrated terminal displays the prompt in an endless loop, as if I would press and hold the Enter key for it to autorepeat.
Attached Logs
See 1539111398-a60423be-01d3-4cc1-83df-f15ead97e8aa1539111394598.zip
Environment Information
Visual Studio Code
| Name | Version |
|---|---|
| Operating System | Windows_NT x64 10.0.17763 |
| VSCode | 1.28.0 |
| PowerShell Extension Version | 2.0.0-insiders-834 |
PowerShell Information
| Name | Value |
|---|---|
| PSVersion | 5.1.17763.1 |
| PSEdition | Desktop |
| PSCompatibleVersions | 1.0 2.0 3.0 4.0 5.0 5.1.17763.1 |
| BuildVersion | 10.0.17763.1 |
| CLRVersion | 4.0.30319.42000 |
| WSManStackVersion | 3.0 |
| PSRemotingProtocolVersion | 2.3 |
| SerializationVersion | 1.1.0.1 |
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
| Extension | Author | Version |
|---|---|---|
| beautify | HookyQR | 1.4.4 |
| cpptools | ms-vscode | 0.19.0 |
| csharp | ms-vscode | 1.16.2 |
| path-intellisense | christian-kohler | 1.4.2 |
| PowerShell | ms-vscode | 2.0.0-insiders-834 |
| prettier-vscode | esbenp | 1.6.1 |
| printcode | nobuhito | 3.0.0 |
| vscode-color | anseki | 0.4.5 |
| vscode-html-css | ecmel | 0.2.0 |
| vscode-javascript-snippet-pack | akamud | 0.1.5 |
| vscode-npm-script | eg2 | 0.3.5 |
| vscode-standardjs | chenxsan | 1.2.3 |
| vscode-tidyhtml | anweber | 1.10.0 |
Well... I must've done something... now even in Windows PowerShell 5.1 I don't get syntax coloring anymore either...
How do I repair that?
(I know, that's somewhat off-topic, but linked to experimenting with versions of PSReadLine in relationship to the present issue...)
We'll have an official preview release this week that will be installable from the extension marketplace.
I hate to say, but the endless loop is still there with that preview...
I've also encountered the endless prompt loop.
Where do we go from here?
What could I do to help fix that?
IMVHO this is a showstopper for version 2.0 of the PowerShell extension for VScode. How can I help getting this resolved?
It is a showstopper for v2.0. We just haven't had a chance to look at the issue yet. I promise we'll address it before release of 2.0!
What would help is providing any information as to what you're doing when the endless loop occurs
Is there anything I can do to help? What would be the setup and tools required to debug this?
I think just use the Preview build, and when you hit the endless loop, let us know (in as much detail as possible) what you were doing when you hit it.
@TylerLeonhardt I have the same problem (endless loop) on my setup :
- VS Code PowerShell Preview
- PSReadline 2.0.0 beta 3
- French Keyboard
My Workaround at the moment is to :
- change keyboard layout to US (from system tray)
- launch VS Code
- change keyboard layout to FR
I try to update to :
- last CI VSCode-PowerShell
- last CI PSReadLine
The problem is still here.
It happened to me this morning just after restarting vscode insiders to install ~the latest~ yesterday's insiders. It happens so seldom that I often don't notice it for a bit and then just hit the trash can and relaunch the extension with no problem :shrug:
I think just use the Preview build, and when you hit the endless loop, let us know (in as much detail as possible) what you were doing when you hit it.
Well... I'm not doing anything special ;-)
But to be more specific here are steps guaranteed to end up with the endless loop (when the preview of the extension is enabled, of course):
- Start VSCode with no folder or file opened
- Open a folder with at least one PowerShell script in it
- Open the PowerShell script
- at this point, the TERMINAL pane shows my PowerShell profile script executing, which ends up with a prompt being displayed... in an endless loop.
I confirm that @fmichaleczek's workaround works.
How can we help further?
Important note about the workaround: every time you switch to another workspace, or do anything where the TERMINAL starts a new PowerShell instance, you have to switch to the US keyboard layout and then back to the French layout.
@sba923 Yes, it's annoying.
The problem is localized after the profile processing script ... so i made a small helper :
Microsoft.VSCode_profile.ps1
$languageToInvert = "fr-FR", "en-US"
$waitInMs = 1500
Set-WinUserLanguageList -LanguageList $LanguageToInvert[1], $LanguageToInvert[0] -Force
$timer = [System.Timers.Timer]@{ Interval = $waitInMs }
Register-ObjectEvent -InputObject $Timer -EventName Elapsed -SourceIdentifier Timer -Action {
Set-WinUserLanguageList -LanguageList $LanguageToInvert[0], $LanguageToInvert[1] -Force
$timer.Stop() ; Unregister-Event Timer ; Remove-Variable languageToInvert, waitSec, timer
} > $null
$timer.Start()
Does this also work if the "VScode PowerShell host" is restarted e.g. after each debugging session?
Yes, the profile script is launched each time the extension is loaded or reloaded. I added an event timer to switch back keyboard to french after some milliseconds.
This works like a charm, thx a zillion.
Of course, that doesn't remove my offer to help with fixing the issue!
Hi all, I have some (potentially) good news. This seems to be an issue in PSReadLine itself and it will be fixed in this PR:
https://github.com/lzybkr/PSReadLine/pull/831
Once that's in, we wait for a release of PSRL, and then we can bundle that with the extension.
IIRC we've known for some time that the issue is in PSRL. Glad that they are tackling it at last.