vscode-powershell: Debug adapter process terminated unexpectedly and PowerShell session has terminated due to an error at the same time and all time

System Details

  • Operating system name and version: Windows Server 2016, Version 1607
  • VS Code version: 1.17.2
  • PowerShell extension version: 1.5.0
  • Output from $PSVersionTable: Name Value

PSVersion 5.1.14393.1532
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
BuildVersion 10.0.14393.1532
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1



code -v : 
1.17.2
b813d12980308015bcd2b3a2f6efa5c810c33ba5

$pseditor.EditorServicesVersion:
Major  Minor  Build  Revision
-----  -----  -----  --------
1      5      0      0

code --list-extensions --show-versions:
azemoh.one-monokai@0.3.4
donjayamanne.python@0.7.0
joshpeng.sublime-babel-vscode@0.2.9
joshpeng.theme-onedark-sublime@0.3.6
jprestidge.theme-material-theme@1.0.1
magicstack.MagicPython@1.0.12
ms-vscode.csharp@1.12.1
ms-vscode.PowerShell@1.5.0
robertohuertasm.vscode-icons@7.17.0
rokoroku.vscode-theme-darcula@1.0.13
tht13.python@0.2.3

$PSVersionTable:
Name                           Value                                                                                                                                     
----                           -----                                                                                                                                     
PSVersion                      5.1.14393.1532                                                                                                                            
PSEdition                      Desktop                                                                                                                                   
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                   
BuildVersion                   10.0.14393.1532                                                                                                                           
CLRVersion                     4.0.30319.42000                                                                                                                           
WSManStackVersion              3.0                                                                                                                                       
PSRemotingProtocolVersion      2.3                                                                                                                                       
SerializationVersion           1.1.0.1 

Issue Description:

“Debug adapter process has terminated unexpectedly” “The PowerShell session has terminated due to an error, would you like to restart”

These two errors keeps popping up every time I run something from VScode, not even while debugging. VSCode has been my primary editor for long but these days its very annoying to keep switching between VSCode for writing and ISE for debugging and running. Please fix.

Attached Logs

logs.zip

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 20

Most upvoted comments

I was puzzled how to repro this. Finally figured it out. If you diff a PS1 file and then in the diff viewer, set a breakpoint in the right pane, a breakpoint of the form Untitled-X will show up in the breakpoints view. We can’t set a line breakpoint unless we have a full file path. So long story short, we’ll fix the crash but breakpoints set in the right pane of the Git diff viewer will not work.