microsoft / microsoft/vscode-cmake-tools

Using "Launch target" doesn't allow reading files from the project root due to weird cwd

Open
#4,103 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement Feature: debug/launch
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

Brief Issue Summary

Clicking "Launch target" runs the resulting executable with cwd = build/Debug. This means it cannot access e.g. the assets folder in the project root, which is a major inconvenience when multiple people are working on the same project and have to be instructed on copying that directory manually.

I haven't been able to find a cross-platform way to automate this besides using a file(COPY ...) hack or modifying the extension config, but it just feels wrong. Is there a different solution that works with the stock settings.json so anybody could just jump right in?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Launch target action and how it selects the working directory when the executable runs from build/Debug. Check the stock settings.json path and the reported file(COPY ...) workaround, then define a cross-platform behavior that lets the executable read project-root assets without manual copying; done means the launch works consistently for project users.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.