Skip to content

Commit a462db4

Browse files
Copilotsnehara99
andauthored
Fix "CMake: Run Without Debugging" not changing working directory when build directory changes (#4694)
* Initial plan * Fix terminal cwd not updating when build directory changes Co-authored-by: snehara99 <[email protected]> * Fix issue number reference from #4689 to #4549 Co-authored-by: snehara99 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: snehara99 <[email protected]>
1 parent e65715e commit a462db4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Features:
88

99
Bug Fixes:
1010

11+
- 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)
1112
- Fix CMake script path links not working in CHS/CSY/FRA/PLK locales due to localized quotes. [#4383](https://github.com/microsoft/vscode-cmake-tools/issues/4383)
1213
- Fix user-level tasks defined in `~/.config/Code/User/tasks.json` causing infinite spinner. [#4659](https://github.com/microsoft/vscode-cmake-tools/pull/4659)
1314
- Fix `cmake.compileFile` failing to find compilation info when using presets without `CMAKE_EXPORT_COMPILE_COMMANDS`. [#4484](https://github.com/microsoft/vscode-cmake-tools/issues/4484)

src/cmakeProject.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,8 +3024,9 @@ export class CMakeProject {
30243024
if (launchBehavior !== "newterminal") {
30253025
for (const [, terminal] of this.launchTerminals) {
30263026
const creationOptions = terminal.creationOptions! as vscode.TerminalOptions;
3027-
// If the environment has changed at all since the last run, dispose of this terminal
3028-
if (JSON.stringify(creationOptions.env) !== JSON.stringify(options.env)) {
3027+
// If the environment or working directory has changed at all since the last run, dispose of this terminal
3028+
if (JSON.stringify(creationOptions.env) !== JSON.stringify(options.env) ||
3029+
JSON.stringify(creationOptions.cwd) !== JSON.stringify(options.cwd)) {
30293030
terminal.dispose();
30303031
break;
30313032
}

0 commit comments

Comments
 (0)