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

Using DAP OutputEvent over stderr for results #2214

Open
2 tasks done
Willem-J-an opened this issue Jan 24, 2025 · 2 comments
Open
2 tasks done

Using DAP OutputEvent over stderr for results #2214

Willem-J-an opened this issue Jan 24, 2025 · 2 comments
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@Willem-J-an
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been requested.

Summary

Currently it seems output streams of the debugee are routed to stderr of the editor services. Is there a reason DAP OutputEvent are not being used for this?
Context:
mfussenegger/nvim-dap#1419 (reply in thread)
The DAP client for nvim recently started routing stderr of debug server to logfiles rather than showing it to users. This change on client side now prevents me from seeing the outputs streams of my debugee in neovim. Apparently most debug servers use OutputEvent to communicate output streams, so clients will be more likely to have support for this!

Proposed Design

Use OutputEvent to communicate the output streams rather than stderr.

@Willem-J-an Willem-J-an added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! labels Jan 24, 2025
@JustinGrote
Copy link
Collaborator

@Willem-J-an thanks for your submission! I imagine this is probably some legacy behavior as PSES predates DAP. I agree this is something we should at least support with an option, marking "Up for Grabs" and will shepherd PRs if someone gets to it before me.

@JustinGrote JustinGrote added Up for Grabs Will shepherd PRs. Area-Debugging and removed Needs: Triage Maintainer attention needed! labels Feb 27, 2025
@JustinGrote
Copy link
Collaborator

After doing some initial investigation, I imagine it has something to do with this in the DAP spec:

Debug adapters are free to launch the debuggee however they choose. Typically the debuggee is launched as a child process and its output channels are connected to a client’s debug console via [output](https://microsoft.github.io/debug-adapter-protocol/specification.html#Events_Output) events. However, this has certain limitations, such as not being able to write to the terminal device directly and not being able to accept standard input. For those cases, launching the debuggee in a terminal is preferable.

Since PowerShell typically operates as a host, and there's some janky stuff we need to do when hitting a debug to be able to get PSCallStack on remote powershell sessions, it would be my guess this is the reason. That being said, I'm sure we can figure something out where, as long as the session is local, to have an alternate output option,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

2 participants