Skip to content

[BUG] ruby launch ignores launchConfig.env — user-provided env never reaches the debuggee #318

Description

@debugmcpdev

Found while investigating #317.

What happens: on the ruby launch path, env passed via dapLaunchArgs is silently dropped. RubyDebugAdapter.buildAdapterCommand builds the spawn environment solely from {...process.env, RUBY_DEBUG_DAP_SHOW_PROTOCOL} and never reads config.launchConfig.env. The value does survive transformLaunchConfig into the DAP launch request args, but that's a dead end: with rdbg --open -c -- ruby <script> the debuggee process is already running by the time the DAP launch request arrives, so rdbg's launch response is effectively an ack and the env is never applied.

Expected: launchConfig.env merged into the spawn env of the rdbg child (e.g. {...process.env, ...launchConfig.env, <adapter-managed vars>}), so users can set env for the debuggee the same way as other adapters. Merge order matters — an explicit user value should win over inherited process.env, and adapter-managed vars should be composed rather than clobbered.

Contrast: attach mode does forward env (if (config.env) attachConfig.env = config.env in transformAttachConfig), and other adapters pass user env through their spawn paths.

Where: packages/adapter-ruby/src/ruby-debug-adapter.tsbuildAdapterCommand (env literal) and buildTargetCommand.

Environment: main, all platforms (structural, not platform-specific).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions