ruby icon indicating copy to clipboard operation
ruby copied to clipboard

Ability to push debug adapter logs to debug terminal/console

Open flaminestone opened this issue 4 months ago • 6 comments

When debugging Ruby code in Zed with the Ruby extension, I only see logs in the DAP panel, and nothing in the console/terminal.

Is it possible to output logs to the console/terminal?

Sorry if this is a stupid question, but I can't find any information about this in the documentation or in the Zed Discord. It seems that the problem is not with Zed, but with my configs or the extension. Image

flaminestone avatar Sep 09 '25 11:09 flaminestone

Hi. I'm not sure if this is related to Zed itself or rdbg but I will have a look. Thanks!

vitallium avatar Nov 02 '25 14:11 vitallium

Hi. I'm not sure if this is related to Zed itself or rdbg but I will have a look. Thanks!

Let me know if there is anything I can do to help

Otterpocket avatar Nov 03 '25 09:11 Otterpocket

I ran into this same issue trying to set up Zed for Ruby development.

I can see console output in the DAP Logs pane but only after the debugging session ends. The first line for me is stderr: DEBUGGER: Disconnected., and after that comes the console output.

ATL-Flaneur avatar Nov 24 '25 00:11 ATL-Flaneur

Dropping some findings:

  1. The debug gem does not natively support redirecting STDOUT/STDERR to DAP. Note, for some reason, that works in VSCode. ~~2. Zed does not capture STDOUT/STDERR either, and both are output to the DAP logs instead.~~

Both findings sound like patches to both upstreams: the debug gem and Zed.

UPD: Zed works just fine.

vitallium avatar Nov 26 '25 13:11 vitallium

By making a wonky, hacky patch to the locally installed debug gem, I was able to get STDOUT in the console:

Image

vitallium avatar Nov 26 '25 14:11 vitallium

Opened an issue on the debug issue tracker https://github.com/ruby/debug/issues/1160 to get confirmation from the authors first.

vitallium avatar Nov 26 '25 21:11 vitallium