Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug terminal #50

Merged
merged 8 commits into from
Oct 17, 2024
Merged

Debug terminal #50

merged 8 commits into from
Oct 17, 2024

Conversation

RemcoSmitsDev
Copy link
Owner

@RemcoSmitsDev RemcoSmitsDev commented Oct 16, 2024

This PR introduces an innovative debugging feature in Zed called the Debug Terminal.

How it works:

When you initiate a debug session, we respond to a runInTerminal reverse request by launching a terminal with specified parameters, including envs and optional args. This allows for direct program execution within the newly opened terminal and allows you to modify any env variables before each time you execute the program that you are trying to debug.

For instance, during a JavaScript debug session, entering node my_program.js prompts the JavaScript debug adapter to automatically attach itself. This seamless integration is possible because the adapter is aware of both the process ID of your active Zed application and the spawned terminal.

Configuration:

Debug terminal for JavaScript

{
  "label": "JavaScript Debug Terminal",
  "command": "JavaScript Debug Terminal",
  "task_type": {
    "type": "debug",
    "kind": "javascript",
    "request": "launch",
    "initialize_args": {
      "console": "integratedTerminal",
      "cwd": "/Users/remcosmits/Documents/code/prettier-test", // This is required for now, later the adapter will insert this.
    }
  }
}

Example:

Screen.Recording.2024-10-16.at.15.02.20.mov

/cc @Anthony-Eid I made the program value optional inside the DebugTaskDefinition

@RemcoSmitsDev RemcoSmitsDev marked this pull request as draft October 16, 2024 15:32
This commit also fixes an issue with not sending a response for the `StartDebugging` reverse request.
@RemcoSmitsDev RemcoSmitsDev marked this pull request as ready for review October 17, 2024 11:33
@RemcoSmitsDev RemcoSmitsDev merged commit 1c1e34b into debugger Oct 17, 2024
0 of 5 checks passed
@RemcoSmitsDev RemcoSmitsDev deleted the debug-terminal branch October 17, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant