When attempting to execute code using F5 or F8 (within the integrated console) PowerShell never completes the action. The PowerShell logo continually spins in the bottom-left corner.
Copying and pasting code into the integrated console runs as expected, and the F8 key works as expected when another terminal is in use.
The code that should be executed is added to the PSReadLine 'Visual Studio Code Host_history.txt' file, but never appears in the console. The console is unusable after attempting to run anything - the only way to make it interactive again is to kill the console or restart VSCode.
I've attempted both the user and system installs of VSCode, as well as using the integrated console with Windows PowerShell and PowerShell Core.
Name Value
---- -----
PSVersion 5.1.19041.1023
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1023
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
-----
Name Value
---- -----
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
1.57.1
507ce72a4466fbb27b715c3722558bb15afa9f48
x64
console PS> code --list-extensions --show-versions | Select-String powershell
[email protected]
[email protected]
test.ps1 containing $test = 'Test'Or:
test.ps1 containing $test = 'Test'_No response_
Seems like every release after 2020.3.0 causes the issue:
2021.6.2 - broken
2021.6.1 - broken
2021.5.1 - broken
2021.2.2 - broken
2020.6.0 - broken
2020.4.0 - broken
2020.3.0 - works
2020.1.0 - works
2019.12.0 - works
2019.11.0 - works
I will do some more digging...
Issue appears to be caused by PowerShellEditorServices and PSReadLine 2.2.0-beta3, specifically introduced in the v2020.4.1-preview release. Using a release prior to 2020.4.1-preview everything works as intended, and similarly, after downgrading from PSReadLine 2.2.0-beta3 to beta2 the issue is resolved for all versions up to and including the latest.
I've raised an issue with PowerShellEditorServices here.