Skip to content

Commit

Permalink
fix: race causing lost sessions when attaching to many concurrent pro…
Browse files Browse the repository at this point in the history
…cesses in the debug terminal

Fixes microsoft/vscode#124060
  • Loading branch information
connor4312 committed Jun 9, 2021
1 parent 4e88fcf commit 69d988b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he
## Nightly

- fix: default F5 not working on files outside workspace ([ref](https://github.com/microsoft/vscode/issues/125796))
- fix: debugging with no launch config fails when tsc task detection is disabled ([ref](https://github.com/microsoft/vscode/issues/69572))
- fix: race causing lost sessions when attaching to many concurrent processes in the debug terminal ([ref](https://github.com/microsoft/vscode/issues/124060))

## v1.57 (May 2021)

Expand Down
4 changes: 3 additions & 1 deletion src/ui/debugTerminalUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const launchVirtualTerminalParent = (
};

launcher.onTargetListChanged(async () => {
const trusted = await vscode.workspace.requestWorkspaceTrust();
const newTargets = new Set<ITarget>();
for (const target of launcher.targetList()) {
newTargets.add(target);
Expand All @@ -98,7 +99,8 @@ export const launchVirtualTerminalParent = (
return;
}

if (!(await vscode.workspace.requestWorkspaceTrust())) {
// Detach from targets if workspace trust was not granted
if (!trusted) {
target.detach();
return;
}
Expand Down

0 comments on commit 69d988b

Please sign in to comment.