Skip to content

Clear attachPersistantProcess for relaunch#276420

Merged
anthonykim1 merged 1 commit intomainfrom
anthonykim1/fixRelaunchCrash
Nov 12, 2025
Merged

Clear attachPersistantProcess for relaunch#276420
anthonykim1 merged 1 commit intomainfrom
anthonykim1/fixRelaunchCrash

Conversation

@anthonykim1
Copy link
Contributor

@anthonykim1 anthonykim1 commented Nov 10, 2025

Resolves: #228359
Was able to repro on Windows, specifically when relaunch terminal right after reloading window or restarting VS Code.

  • Bug doesnt occur if I open new terminal before relaunching the terminal with warning sign.

I thought the attachPersistentProcess is 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 attachPersistentProcess gets passed on relaunch.

@anthonykim1 anthonykim1 added this to the November 2025 milestone Nov 10, 2025
@anthonykim1 anthonykim1 requested a review from Tyriar November 10, 2025 03:29
@anthonykim1 anthonykim1 self-assigned this Nov 10, 2025
Copilot AI review requested due to automatic review settings November 10, 2025 03:29
@anthonykim1 anthonykim1 marked this pull request as ready for review November 10, 2025 03:30
Copy link
Contributor

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 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 attachPersistentProcess property before relaunching
  • Ensures terminals create new processes during relaunch operations instead of trying to reattach

Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

This makes sense and seems like it should be fairly safe. Good find 👍

@anthonykim1 anthonykim1 merged commit b625e08 into main Nov 12, 2025
33 of 34 checks passed
@anthonykim1 anthonykim1 deleted the anthonykim1/fixRelaunchCrash branch November 12, 2025 21:20
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relaunching the terminal will often just close the terminal

3 participants