Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 12, 2025

Users can now run jsdbg <command> in any terminal to start a debug session, eliminating the need to manually create and switch to a JavaScript Debug Terminal.

Implementation

  • src/ui/jsdbgCommand.ts: Listens for jsdbg commands via onDidStartTerminalShellExecution and creates a JavaScript Debug Terminal with the extracted command, preserving the original terminal's working directory.

  • src/extension.ts: Registers the jsdbg handler on activation.

Usage

# Before: switch to debug terminal, re-navigate
jsdbg node myScript.js

# Also works with npm, yarn, etc.
jsdbg npm start
jsdbg yarn test

The command reuses the existing CreateDebuggerTerminal infrastructure. Requires shell integration to be enabled in VS Code (default for most shells).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)
  • plugins.dprint.dev
    • Triggering command: /home/REDACTED/work/vscode-js-debug/vscode-js-debug/node_modules/dprint/dprint fmt OPTIONS.md (dns block)
    • Triggering command: /home/REDACTED/work/vscode-js-debug/vscode-js-debug/node_modules/dprint/dprint check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Allow debugging a nodejs from a non-"JavaScript Debug Terminal" via jsdbg command</issue_title>
<issue_description>It would be awesome if some kind of jsdbg would allow me to debug nodejs apps in a standard terminal.

My current flow is:

  1. cd myDir (in a standard terminal)
  2. node myScript.js
  3. -> crashes
  4. Create and switch to a new javascript debug terminal
  5. cd myDir
  6. node myScript.js
  7. Happy debugging with VS Code debugger
  8. Close debug terminal
  9. Continue with normal terminal

I'd be very happy if the flow was this:

  1. cd myDir (in a standard terminal)
  2. node myScript.js
  3. -> crashes
  4. jsdbg node myScript.js
  5. Happy debugging with VS Code debugger
  6. Continue with normal terminal</issue_description>

<agent_instructions>There is already copilot-debug. Can you follow that approach to create jsdbg that immediately attaches to the nodejs process, like the js debug terminal does?</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 12, 2025 10:41
Co-authored-by: hediet <2931520+hediet@users.noreply.github.com>
Co-authored-by: hediet <2931520+hediet@users.noreply.github.com>
Co-authored-by: hediet <2931520+hediet@users.noreply.github.com>
Copilot AI changed the title [WIP] Add jsdbg command for nodejs debugging in standard terminal Add jsdbg command for debugging Node.js from any terminal Nov 12, 2025
Copilot finished work on behalf of hediet November 12, 2025 10:55
Copilot AI requested a review from hediet November 12, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow debugging a nodejs from a non-"JavaScript Debug Terminal" via jsdbg command

2 participants