deno
ffa03c09 - fix: support --inspect family in NODE_OPTIONS (#34717)

Commit
27 days ago
fix: support --inspect family in NODE_OPTIONS (#34717) Deno already reads a couple of flags from `NODE_OPTIONS` (`--require`/`-r` and `--inspect-publish-uid`), but it filtered out the inspector activation flags. Node honors `--inspect`, `--inspect-brk`, and `--inspect-wait` via `NODE_OPTIONS`, and tooling that activates the inspector through the environment rather than an explicit flag relies on this. The most common case is VS Code's "JavaScript Debug Terminal", which auto-attaches by injecting environment variables into the terminal so any launched process starts its inspector; without honoring these flags, `deno run` in that terminal never starts the inspector. This extends `apply_node_options` to also parse `--inspect`, `--inspect-brk`, and `--inspect-wait` from `NODE_OPTIONS`. Since the three are mutually exclusive, an explicit inspector flag passed on the command line suppresses the entire `NODE_OPTIONS` inspector family, so a CLI flag always takes precedence. This is a step towards #19328 (full VS Code JavaScript Debug Terminal support may still need changes in the vscode_deno extension to inject the appropriate environment, but the runtime side now supports env-based inspector activation). Closes #28474.
Author
Parents
Loading