-
Notifications
You must be signed in to change notification settings - Fork 517
Add temporaryConsoleWindowActionOnDebugEnd option #5255
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
base: main
Are you sure you want to change the base?
Conversation
Adds a new option `temporaryConsoleWindowActionOnDebugEnd` to both the attach and launch configurations which can be used to specify what happens with the temporary integrated console when a debug session ends. The option can be set to `keep`, current behaviour and default, that will keep the active terminal as the temporary console. It can be set to `close` which closes the terminal and removes it from the selection pane or `hide` which keeps the terminal window alive but changes the active terminal to the previous one before the debug session started.
There was a problem hiding this 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 a new configuration option temporaryConsoleWindowActionOnDebugEnd
that controls the behavior of temporary console windows when PowerShell debug sessions end. The feature provides three options: "keep" (default, maintains current behavior), "close" (removes the terminal), and "hide" (restores the previous active terminal).
- Adds the new configuration option to both attach and launch debug configurations
- Implements event handling to manage terminal state when debug sessions terminate
- Provides configurable behavior for temporary console cleanup with backward compatibility
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/features/DebugSession.ts | Implements the core logic for handling terminal state changes and debug session event listening |
package.json | Defines the new configuration schema with enum values and descriptions for both attach and launch configurations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tested working. Thanks Jordan.
Patrick and I just have the question: what do we need |
Hide is useful if you want the active window to go back to what was there before it was launched but still want the temp console window available to either see the history or in a launch scenario to run further commands in that runspace state, e.g. get vars, run functions defined in the launch script, etc. The reason I didn't go with close (or hide) by default is one that's not how it works today and a user may still want to go back in the history/output to see what has happened after the debug session ended. I also thought it might be a bit confusing if a launch session had a different default to attach so decided to just align them to the same default. |
PR Summary
Adds a new option
temporaryConsoleWindowActionOnDebugEnd
to both the attach and launch configurations which can be used to specify what happens with the temporary integrated console when a debug session ends. The option can be set tokeep
, current behaviour and default, that will keep the active terminal as the temporary console. It can be set toclose
which closes the terminal and removes it from the selection pane orhide
which keeps the terminal window alive but changes the active terminal to the previous one before the debug session started.Issue for this feature was opened under PowerShell/PowerShellEditorServices#2247 but the actual implementation needs to be done here.
PR Checklist
WIP:
to the beginning of the title and remove the prefix when the PR is ready