zed-industries/zed · error

failed to receive response from spawn terminal

Error message

failed to receive response from spawn terminal

What it means

After emitting SessionEvent::RunInTerminal to ask the UI to spawn a terminal, the response channel closed before a terminal pid was sent back — the receiver was dropped (no handler accepted the task, or the UI shut down). The DAP client therefore cannot be told where the debuggee runs.

Source

Thrown at crates/project/src/debugger/session.rs:1226

                    Err(anyhow!("Failed to parse RunInTerminalRequestArguments"))
                });
            }
        };

        let seq = request.seq;

        let (tx, mut rx) = mpsc::channel::<Result<u32>>(1);
        cx.emit(SessionEvent::RunInTerminal {
            request: request_args,
            sender: tx,
        });
        cx.notify();

        cx.spawn(async move |session, cx| {
            let result = util::maybe!(async move {
                rx.next().await.ok_or_else(|| {
                    anyhow!("failed to receive response from spawn terminal".to_string())
                })?
            })
            .await;
            let (success, body) = match result {
                Ok(pid) => (
                    true,
                    serde_json::to_value(dap::RunInTerminalResponse {
                        process_id: None,
                        shell_process_id: Some(pid as u64),
                    })
                    .ok(),
                ),
                Err(error) => (
                    false,
                    serde_json::to_value(dap::ErrorResponse {
                        error: Some(dap::Message {
                            id: seq,
                            format: error.to_string(),

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Ensure a RunInTerminal handler is registered and responds exactly once for every emitted event
  2. Check whether the session was torn down mid-request; retry the launch after restarting
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/project/src/debugger/session.rs:1226 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/176440ec6c4afe9e. Report an issue: GitHub.