Clear attachPersistantProcess for relaunch#276420
Merged
anthonykim1 merged 1 commit intomainfrom Nov 12, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where relaunching a terminal would attempt to reattach to the existing persistent process instead of creating a new one. The fix ensures that when a terminal is relaunched, a fresh process is created by clearing the attachPersistentProcess flag from the shell launch configuration.
- Adds logic to create a shallow copy of the shell launch config and remove the
attachPersistentProcessproperty before relaunching - Ensures terminals create new processes during relaunch operations instead of trying to reattach
Tyriar
approved these changes
Nov 12, 2025
Member
Tyriar
left a comment
There was a problem hiding this comment.
This makes sense and seems like it should be fairly safe. Good find 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #228359
Was able to repro on Windows, specifically when
relaunch terminalright after reloading window or restarting VS Code.I thought the
attachPersistentProcessis only meant for initial revival/restoration after reload, not for user-initiated relaunches.I think the problem is that we try to shutdown process and attach to that same process because
attachPersistentProcessgets passed on relaunch.