codelldb: Error launching terminal agent on Windows

Which OS: Windows Which VSCode version: 1.38.1 Which extension version: 1.3.0 Which adapter type: native Which LLDB version: lldb version 8.0.1

attempt to debug a standard cargo binary on windows with powershell as the terminal.

PS C:\Users\tyler\Code\guessing_game> & '
>> ' 'c:\Users\tyler\.vscode\extensions\vadimcn.vscode-lldb-1.3.0\adapter2\codelldb.exe' 'terminal-agent' '--port=53254'
& : The term '
' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ & '
+   ~
+ CategoryInfo          : ObjectNotFound: (
:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

running the command myself properly and I get, as the window of opportunity passed evidenced by the debug console error below.

Error: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }

and in the Debug Console I get

Failed to redirect stdio to a terminal. (Internal debugger error: Terminal agent did not respond within the allotted time.)
Debuggee output will appear here.```


About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

Hi… There seems to be a resurgence of this issue:

PS C:\Development\Rust\PRTGC-Sensors\moah_client>  & '
>> '
& : The term '
' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:4
+  & '
+    ~
    + CategoryInfo          : ObjectNotFound: (
:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
PS C:\Development\Rust\PRTGC-Sensors\moah_client>  & 'c:\Users\JR\.vscode\extensions\vadimcn.vscode-lldb-1.5.3\adapter\codelldb.exe' 'terminal-agent' '--port=58650'
Error: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }
PS C:\Development\Rust\PRTGC-Sensors\moah_client>
C:\Users\JR>netstat -ano |grep 12156
  TCP    127.0.0.1:58648        0.0.0.0:0              LISTENING       12156
  TCP    127.0.0.1:58648        127.0.0.1:58649        ESTABLISHED     12156

Default host: x86_64-pc-windows-msvc installed toolchains

stable-x86_64-pc-windows-msvc nightly-x86_64-pc-windows-msvc

installed targets for active toolchain

i686-pc-windows-msvc x86_64-pc-windows-msvc

active toolchain

stable-x86_64-pc-windows-msvc (default) rustc 1.44.1 (c7087fe00 2020-06-17)

cargo 1.44.1 (88ba85757 2020-06-11)

Fixed in 1.4.1 actually.

To get rid of error messages when using PowerShell as a terminal shell in VSCode, you can set "lldb.terminalPromptClear" : null in user/workspace settings. Of course, this disables protection from junk input in the terminal (see above). Tradeoffs…

I had the same problem. In launch.json, change the "terminal":"integrated" to "terminal":"external". If it correctly works, add "terminal.integrated.shell.windows":"C:\\Windows\\System32\\cmd.exe" to settings.json. In my case it worked fine in “integrated” after adding in settings.json.

See the following address. https://github.com/Microsoft/vscode/issues/22881