Skip to content

Allow the use of the currently selected PowerShell terminal for .ps1 file debugging #4824

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

Closed
2 tasks done
tolgabalci opened this issue Nov 13, 2023 · 2 comments
Closed
2 tasks done
Labels
Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically.

Comments

@tolgabalci
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

It would a better experience in VSCode when a .ps1 file is selected, if there already is a compatible PowerShell terminal selected, it is used rather than launching an instance of "PowerShell Extension".

image

In the above screenshot, you can see "PowerShell Extension" was launched after I selected a .ps1 file, even though I already had a pwsh terminal open.

Proposed Design

I realize this would require some sort of connection to the selected terminal and I can see some users objecting to this behavior, but I think those would be edge cases that can be addressed with an option to turn off the behavior.

In addition to using the currently selected compatible PowerShell terminal for the execution of a .ps1, if the current terminal window is changed to another compatible PowerShell terminal window, then the next time the script is executed in the debugger, the selected terminal session is used. Yes, it's duplicating the memory of all the session variables between the two terminals, but there are advantages of keeping the state separately. For example, maybe the user wants to try a quick sidebar idea without interfering with the main terminal and all the values that are present there.

At one point I would even like to be able to start a long-running script in one terminal and continue debugging another script in another terminal. I regularly execute hundreds of PowerShell scripts, some of which take over 10 minutes to complete. If I need to run another script that I may need to monitor, I have no recourse. I cannot even launch another instance of VSCode and point to the same folder so I can run another script, since VSCode doesn't support opening the same folder from two instances.

@tolgabalci tolgabalci added the Issue-Enhancement A feature request (enhancement). label Nov 13, 2023
@SydneyhSmith
Copy link
Collaborator

Thanks for the request, this looks like largely the same ask as #2418

@SydneyhSmith SydneyhSmith added the Resolution-Duplicate Will close automatically. label Nov 29, 2023
@github-actions github-actions bot added the Stale label Nov 30, 2023
Copy link
Contributor

This issue has been labeled as resolved and has not had any activity for one or more days. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants