-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'cwd' option is not respected in launch.json #8084
Comments
I can confirm that this is specific to
(Not sure if it is relevant or not, but I am also on macOS, 11.5.) |
quoting from here: microsoft/vscode#27157 |
@elahehrashedi - Thanks for the additional info - so it's a good thing that this issue is on the repository of the |
It seems that this is still an issue in version 1.8.5 (pre-release). Is there any workaround for this? I just want the debug configuration to launch the program with a current working directory of {$workspaceFolder}, but it seems to always start from the CMake build directory :-( |
@WardenGnaw / anyone else? @elahehrashedi's comment seems to imply that the issue is in the right place. The behaviour changed between 1.5.1 and 1.6.0; from @ennorehling's comment, it still seems be an issue in 1.8.5; and it seems to be a genuine issue, affecting some people's ability to use the tool effectively. |
I'm facing a similar issue on VS too. I hate |
Have the same Issue with python and linux. |
Same for me. Have the same Issue with python. |
My understanding is that the |
@Colengms - That proposed source of the problem doesn't fit with the issue depending on the version of VS Code. |
Hi @mikebeaton . Some code was changed between these versions such that the issue with lldb-mi was exposed. We can use this issue to track implementing a work around, but the ideal fix would come from lldb-mi. |
Might not be relevant to finding the source of the problem but I thought i would mention that i have similar issues on Ubuntu when running a gdb debug launch |
CORRECT!!!!!!!Thank you very much |
This one is hitting me, too. Visual Studio 2022 with latest updated workloads for C/C++ and CMake. Is there any solution? |
We are having the same issue with the Python (3.10) debugger. The |
Having the same issue debugging a C++ application. Cwd is completely ignored |
Same issue debugging a rust app with lldb. |
in my case, putting"cwd" option in the launch.json does not start debugging at all! when I remove the "cwd" option, then it starts debugging. this is weird. I am using Python debugger |
Just to keep question alive, I can confirm the mentioned behavior by "b-y-f". Starting debug from drop-down-arrow (top right of Studio Code in the tool bar) ignores at least cwd setting in launch.js. Using F5 to start debug session respects the settings in launch.json and therefore work as expected. |
@elahehrashedi Is this a build task issue? |
@sean-mcmanus I tested this, and I beleive this is not a task issue. |
This is also happening to me in Visual Studio 2022 17.5.1, debugging a CMake target. All programs start in my home folder. |
@elahehrashedi @sean-mcmanus What more info do you need? I am happy to re-check and re-test and gather any info, if it will help. |
@mikebeaton I don't know. I don't repro the issue. @WardenGnaw Do you have any idea? I'm guessing this is a debugger issue? |
I was having this issue, and noticed there was a |
Latest macos, latest vscode. Can confirm: |
Issue seems to be present for rust debugging via lldb, whether activated via F5, or the debug play button.
Application output snippet:
Where VSCode: 1.77.1 System Info Any more details I can provide please let me know. |
I noticed that it does not work, even when using from the debug panel (top left button) if the "Python Debug Console" is not already open. Once the "Python Debug Console" is open, it will work (if you hit the debug button again). |
I should add that, in my configuration, I have "console" set to "integratedTerminal" |
Still happens on Visual Studio 2022 17.6.4 :( This is such a basic feature and it doesn't work ... why?! |
@KubaO This issue is about the VS Code C++ extension and not Visual Studio 2022. Did you mention the wrong product by mistake? |
Same issue exists in both. Perhaps some code is shared? |
@KubaO Okay, sounds like it could be some shared debugger code. |
I also ran into this issue trying launch cargo to debug rust with lldb, seemingly because I was able to get the debugger to launch by specifying the {
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'server'",
"cargo": {
"args": [
"build",
"--manifest-path", "${workspaceFolder}/backend/Cargo.toml",
"--bin=server",
],
"filter": {
"name": "server",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}/backend"
},
]
} |
For me it doesn't work with play button or F5 ! Setting
This sucks because then there is another issue with |
Which "left panel" are you referring to? It doesn't work for me, none of the VS code ever worked. Is there a workaround for this? Shouldn't Microsoft prioritize this? I mean debugging is one of the most important things in programming and this bug has been open since 2021... |
@KubaO thanks for your advise! It worked for me. |
Bug type: General
After updating to 1.6.0 of this extension the cwd option stopped working for all of my launch.json configs. Example config:
To verify I created a test program like:
which on 1.6.0 prints the incorrect "/private/tmp" when launching through vscode. If I manually downgrade to 1.5.1 I get the expected output (the actual cwd specified in the launch.json file).
The text was updated successfully, but these errors were encountered: