Skip to content

Add Start-DebugAttachSession function #2249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jborean93
Copy link
Contributor

@jborean93 jborean93 commented Jul 25, 2025

PR Summary

Adds the Start-DebugAttachSession cmdlet which can be used to launch a new attach session debug request inside an existing launched debug session. This allows a script being debugged to launch a child debugging session using more dynamic environment information without requiring end users to manually setup the launch.json configuration.

PR Context

Fixes: #2244

Examples added with: PowerShell/vscode-powershell#5246

Adds the `Start-DebugAttachSession` cmdlet which can be used to launch a
new attach session debug request inside an existing launched debug
session. This allows a script being debugged to launch a child debugging
session using more dynamic environment information without requiring end
users to manually setup the launch.json configuration.
@Copilot Copilot AI review requested due to automatic review settings July 25, 2025 05:21
@jborean93 jborean93 requested a review from a team as a code owner July 25, 2025 05:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the Start-DebugAttachSession cmdlet that enables launching a new attach session debug request from within an existing debug session. This allows scripts to dynamically start child debugging sessions without requiring manual launch.json configuration.

Key changes:

  • Added new Start-DebugAttachSession PowerShell function with comprehensive parameter support
  • Implemented debug server variable management for session lifecycle
  • Added comprehensive documentation and examples

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
LaunchAndAttachHandler.cs Sets global debug server variable during launch for child session access
DisconnectHandler.cs Cleans up debug server variable on disconnect for non-attach sessions
DebugService.cs Defines constant for debug server variable name
Start-DebugAttachSession.ps1 Main cmdlet implementation with parameter validation and debug request handling
Start-DebugAttachSession.md Comprehensive documentation with examples and parameter descriptions
PowerShellEditorServices.Commands.md Updates module documentation to include new cmdlet
PowerShellEditorServices.Commands.psd1 Exports new function in module manifest

jborean93 and others added 2 commits July 26, 2025 05:48
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.

Support startDebugging DAP reverse request
1 participant