Skip to content

debug.javascript.autoAttachFilter setting is not respected #923

@cruzj6

Description

@cruzj6

Describe the bug
The debug.javascript.autoAttachFilter setting is not respected. autoAttachMode is always set to always in VSCODE_INSPECTOR_OPTIONS.

Here's the command it's using when I run the launch config:

/usr/bin/env 'NODE_OPTIONS=--require /home/node/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/extensions/ms-vscode.js-debug/src/bootloader.bundle.js --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/tmp/node-cdp.182-2.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/local/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/tmp/node-debug-callback-559cc875db498717"}' /usr/local/bin/node ./runServices.js 

To Reproduce
Steps to reproduce the behavior:

  1. Set debug.javascript.autoAttachFilter either via the UI or settings.json to anything except always (disabled probably simplest)
  2. Create a launch.json config with type node and request launch that spawns a node process that shouldn't be attached to due to the auto attach filter.
  3. Run the config
  4. Notice the debugger attaches to every node process and sub-process that runs

Log File

(emailed)

VS Code Version: 1.53.1

Additional context
Here's my settings - as you can see it is disabled:
Screen Shot 2021-02-09 at 11 28 43 PM

Also it shows the mode correctly in the editor's footer when I change it to smart or onlyWithFlag, but that's not reflected when it actually runs the command:
Screen Shot 2021-02-09 at 11 30 35 PM

Here's my launch config in launch.json:

    {
      "type": "node",
      "request": "launch",
      "name": "Run All Services",
      "program": "${workspaceFolder}/runServices.js",
      "sourceMaps": true,
      "outFiles": ["${workspaceFolder}/services/*/.webpack/**/*.js"],
      "skipFiles": [
        "${workspaceFolder}/**/node_modules/**/*.js",
        "<node_internals>/**/*.js"
      ],
      "resolveSourceMapLocations": [
        "${workspaceFolder}/**",
        "!**/node_modules/**"
      ],
      "trace": true,
    },

Metadata

Metadata

Assignees

Labels

*as-designedDescribed behavior is as designedbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions