Vscode-powershell: Changing language type of pasted code in new file crashes pwsh terminal session

Created on 17 Jan 2019  Â·  4Comments  Â·  Source: PowerShell/vscode-powershell

System Details


System Details Output

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version: 1.10.2.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      6.1.1
PSEdition                      Core
GitCommitId                    6.1.1
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

Changing language type of pasted code in new file crashes pwsh terminal session
To reproduce:

  1. Set default filetype to .ps1
  2. Open existing .ps1 containing JSON here-string.
  3. Copy and paste JSON to new file
  4. Change filetype of new file to JSON
  5. vs-code powershell crashes terminal

Expected Behaviour

Extension should not crash pwsh terminal session.

Actual Behaviour

Extension crashes pwsh terminal session.

Attached Logs

terminal

vscode-powershell-logs.zip

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

Issue-Bug Issue-Performance

All 4 comments

This looks like it might be https://github.com/PowerShell/vscode-powershell/issues/1649.

Is your default file type set to PowerShell? If so, does commenting out that setting fix the problem?

Nice catch, @rjmholt.

Yes, default type is set to ‘powershell’ Vscode is an ISE replacement for me so it’s more convenient to set the default type to .ps1.

I’ll try changing the default to something else.

Removing 'powershell' from the files.defaultLanguage setting stops the terminal from crashing, so the problem is likely a dup of #1649.

@yobyot thanks for checking that! I will close this issue for now as a dup of #1649 but please let us know if you start running into this issue again

Was this page helpful?
0 / 5 - 0 ratings