microsoft / microsoft/vscode-js-debug

When using "code" command "auto attach gets destroyed"

Open
#2,177 0 comments 0 reactions 1 assignee View on GitHub

@connor4312 is already working on this.

Since Mar 3, 2025.

bug
Dominant language
TypeScript
Stars
2k
Forks
373
Avg merge
1d 9m
Merged PRs (30d)
6

Description

Describe the bug
If you're in an "auto attach" shell, then using the "code" command to open another project will cause
two instances of the --register arg in NODE_OPTIONS

To Reproduce
Steps to reproduce the behavior:

  1. Go to project
  2. Click on Auto attach
  3. Scroll down to Always
  4. Open new Terminal (the existing terminal will hava a little flag, because the env was not synched)
  5. Execute "code ANOTHERPROJECT"
  6. Do "echo $NODE_OPTIONS" in terminal and you'll see multiple debugger attachments.
  7. Trying to auto attach will end up with a weird error saying it can't find something.

Log File

It's not necessary, it's pretty obvious what's happening, but if you really need it I can see if I can capture it.

VS Code Version:
Version: 1.97.2
Commit: e54c774e0add60467559eb0d1e229c6452cf8447
Date: 2025-02-12T23:20:35.343Z
Electron: 32.2.7
ElectronBuildId: 10982180
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.3.0

Additional context
This was happening every once in a while and I couldn't figure out why. Most of the time I have an open instance of alacritty to launch my new project windows using "code PROJECT" instead of using the terminals within each projects.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.