Skip to content

Run in terminal fails with lldb-dap timeout #1354

@timsneath

Description

@timsneath

Describe the bug
I'm working on an interactive command line app using Swift, and because it uses raw mode ANSI VT commands it needs to run in an external terminal rather the built-in VSCode terminal.

Adding the "runInTerminal": true entry to launch.json should enable this, but when running a debug session, it times out with an error message:

Timed out trying to get messages from the debug adaptor

To Reproduce
Steps to reproduce the behavior:

  1. Create a console app
  2. Set a breakpoint
  3. Add the "runInTerminal": true entry to launch.json to set a debug configuration that uses the system terminal.
  4. Start debug in VSCode
  5. Error:
Image

Command line in terminal shows as:

cd /Users/timsneath/src/kilo-swift ; /usr/bin/env /Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap --comm-file /var/folders/0_/gnsdt09d1j131m349083j4f40000gn/T/lldb-dap-run-in-terminal-comm-4afc92 --debugger-pid 76637 
--launch-target /Users/timsneath/src/kilo-swift/.build/debug/kilo 

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS: macOS Sequoia 15.3
  • Swift version (output of swift --version)

swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0

  • Visual Studio Code version: Version: 1.96.4 (Universal)
  • vscode-swift version: 1.11.4

Additional context
Full launch.json:

{
    "configurations": [
        {
            "type": "swift-lldb",
            "request": "launch",
            "args": [],
            "runInTerminal": true,
            "cwd": "${workspaceFolder:kilo-swift}",
            "name": "Debug kilo",
            "program": "${workspaceFolder:kilo-swift}/.build/debug/kilo",
            "preLaunchTask": "swift: Build Debug kilo",
        },
        {
            "type": "swift-lldb",
            "request": "launch",
            "args": [],
            "cwd": "${workspaceFolder:kilo-swift}",
            "name": "Release kilo",
            "program": "${workspaceFolder:kilo-swift}/.build/release/kilo",
            "preLaunchTask": "swift: Build Release kilo"
        }
    ]
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Next

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions