Skip to content
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

Detect suspended terminal on start #820

Merged
merged 1 commit into from
Jul 9, 2022

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Jul 9, 2022

This commit detects if there is an existing suspended terminal named 'Puppet PDK' and uses that instead of blindly creating a new one. If no terminal is found, it creates it's own.

Previously VS Code removed all disposed terminals created by extensions on close. VS Code has since enabled suspending terminals, which persist shutting off VS Code and are reanimated when started again.

The PDK command integration was built before the possibility of terminal suspension. When this extension starts, it creates a integrated terminal to use for PDK Commands, which is then suspended on VS Code close. When it's started again, this extension creates a new terminal, resulting in duplicate terminals. Adding logic to detect existing terminals removes this problem.

This commit detects if there is an existing suspended terminal named 'Puppet PDK' and uses that instead of blindly creating a new one. If no terminal is found, it creates it's own.

Previously VS Code removed all disposed terminals created by extensions on close. VS Code has since enabled suspending terminals, which persist shutting off VS Code and are reanimated when started again.

The PDK command integration was built before the possibility of terminal suspension. When this extension starts, it creates a integrated terminal to use for PDK Commands, which is then suspended on VS Code close. When it's started again, this extension creates a new terminal, resulting in duplicate terminals. Adding logic to detect existing terminals removes this problem.
@CLAassistant
Copy link

CLAassistant commented Jul 9, 2022

CLA assistant check
All committers have signed the CLA.

@jpogran jpogran marked this pull request as ready for review July 9, 2022 19:36
@jpogran jpogran requested a review from a team as a code owner July 9, 2022 19:36
Copy link
Contributor

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

A very welcome PR. Thank you 🙏

@chelnak chelnak merged commit fccf88b into puppetlabs:main Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants