From d758b7f27277020a49605e6e55337ec5401a62b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 20:47:13 +0000 Subject: [PATCH 1/4] Initial plan From 46dce216cdda0de8d696d4435c507a2d2da4261f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 20:51:30 +0000 Subject: [PATCH 2/4] Fix terminal cwd not updating when build directory changes Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com> --- CHANGELOG.md | 1 + src/cmakeProject.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c8f1262da..d01c0a4797 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Features: Bug Fixes: +- Fix "CMake: Run Without Debugging" not changing the working directory when the build directory changes. [#4689](https://github.com/microsoft/vscode-cmake-tools/issues/4689) - Fix user-level tasks defined in `~/.config/Code/User/tasks.json` causing infinite spinner. [#4659](https://github.com/microsoft/vscode-cmake-tools/pull/4659) - Fix "Copy Value" in CMake debugger copying variable name instead of value. [#4551](https://github.com/microsoft/vscode-cmake-tools/issues/4551) - cmakeDriver: Fixes getCompilerVersion by using compilerPath instead of compilerName. [#4647](https://github.com/microsoft/vscode-cmake-tools/pull/4647) [@lygstate](https://github.com/lygstate) diff --git a/src/cmakeProject.ts b/src/cmakeProject.ts index afea14ba4a..b89b415b1d 100644 --- a/src/cmakeProject.ts +++ b/src/cmakeProject.ts @@ -3024,8 +3024,9 @@ export class CMakeProject { if (launchBehavior !== "newterminal") { for (const [, terminal] of this.launchTerminals) { const creationOptions = terminal.creationOptions! as vscode.TerminalOptions; - // If the environment has changed at all since the last run, dispose of this terminal - if (JSON.stringify(creationOptions.env) !== JSON.stringify(options.env)) { + // If the environment or working directory has changed at all since the last run, dispose of this terminal + if (JSON.stringify(creationOptions.env) !== JSON.stringify(options.env) || + creationOptions.cwd !== options.cwd) { terminal.dispose(); break; } From 7b6c06464b3971ce16782ff71da9bbccf65c396f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:38:00 +0000 Subject: [PATCH 3/4] Fix issue number reference from #4689 to #4549 Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d01c0a4797..6054b27b92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Features: Bug Fixes: -- Fix "CMake: Run Without Debugging" not changing the working directory when the build directory changes. [#4689](https://github.com/microsoft/vscode-cmake-tools/issues/4689) +- Fix "CMake: Run Without Debugging" not changing the working directory when the build directory changes. [#4549](https://github.com/microsoft/vscode-cmake-tools/issues/4549) - Fix user-level tasks defined in `~/.config/Code/User/tasks.json` causing infinite spinner. [#4659](https://github.com/microsoft/vscode-cmake-tools/pull/4659) - Fix "Copy Value" in CMake debugger copying variable name instead of value. [#4551](https://github.com/microsoft/vscode-cmake-tools/issues/4551) - cmakeDriver: Fixes getCompilerVersion by using compilerPath instead of compilerName. [#4647](https://github.com/microsoft/vscode-cmake-tools/pull/4647) [@lygstate](https://github.com/lygstate) From c4557d65cf5d3db2ff2d452ea338903f0a47d8cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 19:35:35 +0000 Subject: [PATCH 4/4] Use JSON.stringify() for cwd comparison for consistency Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com> --- src/cmakeProject.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmakeProject.ts b/src/cmakeProject.ts index b89b415b1d..558f226c36 100644 --- a/src/cmakeProject.ts +++ b/src/cmakeProject.ts @@ -3026,7 +3026,7 @@ export class CMakeProject { const creationOptions = terminal.creationOptions! as vscode.TerminalOptions; // If the environment or working directory has changed at all since the last run, dispose of this terminal if (JSON.stringify(creationOptions.env) !== JSON.stringify(options.env) || - creationOptions.cwd !== options.cwd) { + JSON.stringify(creationOptions.cwd) !== JSON.stringify(options.cwd)) { terminal.dispose(); break; }