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 |
Does this give a hint on what's going on?
PS ~/powershell> gmo psreadline
PS ~/powershell> import-module -verbose psreadline
VERBOSE: Loading module from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\psreadline.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.6.1 because it is not included in the list of permitted versions.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\PSReadLine.format.ps1xml'.
VERBOSE: Loading module from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\Microsoft.PowerShell.PSReadLine2.dll'.
VERBOSE: Importing cmdlet 'Get-PSReadLineOption'.
VERBOSE: Importing cmdlet 'Set-PSReadLineOption'.
VERBOSE: Importing cmdlet 'Set-PSReadLineKeyHandler'.
VERBOSE: Importing cmdlet 'Get-PSReadLineKeyHandler'.
VERBOSE: Importing cmdlet 'Remove-PSReadLineKeyHandler'.
VERBOSE: Loading module from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\PSReadLine.psm1'.
VERBOSE: Exporting function 'PSConsoleHostReadLine'.
VERBOSE: Exporting cmdlet 'Get-PSReadLineOption'.
VERBOSE: Exporting cmdlet 'Set-PSReadLineOption'.
VERBOSE: Exporting cmdlet 'Set-PSReadLineKeyHandler'.
VERBOSE: Exporting cmdlet 'Get-PSReadLineKeyHandler'.
VERBOSE: Exporting cmdlet 'Remove-PSReadLineKeyHandler'.
VERBOSE: Importing cmdlet 'Get-PSReadLineKeyHandler'.
VERBOSE: Importing cmdlet 'Get-PSReadLineOption'.
VERBOSE: Importing cmdlet 'Remove-PSReadLineKeyHandler'.
VERBOSE: Importing cmdlet 'Set-PSReadLineKeyHandler'.
VERBOSE: Importing cmdlet 'Set-PSReadLineOption'.
VERBOSE: Importing function 'PSConsoleHostReadLine'.
@SydneyhSmith @TylerLeonhardt I tested beta4 (On preview 2) on 2 PCs and it looks like it working. With beta3 if keyboard is on Hebrew and I start the terminal I get the loop, with beta4 I don't have this problem. Thank you
@sba923 Get-Module PSReadLine means that PSRL is not loaded in your session. However, if you run Set-PSReadLineKeyHandler or something in your profile, that will cause module autoloading to load PSRL.
We probably load PSRL after profiles are run, but if your profile runs a cmdlet from PSRL, it will cause it to load PSRL and all will be fine.
We can close this issue now as being an external issue fixed in the next release of PSRL but @sba923 if you have more concerns regarding when PSRL gets loaded, feel free to open a new issue.
Thanks to all who contributed to this fix! ISE's grave is getting deeper ;-)
@TylerLeonhardt Yes I will open another issue for the problem where PSRL doesn't get loaded in some circumstances: when this happens not only don't I get PSRL in my VScode session, but also if I load it manually using Import-Module it doesn't behave properly (no syntax highlighting, so history backed by a file on disk....)
Opened #1834
@sba923 That link in your comment is broken (leads to: https://github.com/PowerShell/vscode-powershell/issues/url)
Fixed, thanks for the remark.