You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DAP: a configuration created from a file keeps the project's directory as working directory, so a subdirectory's environment doesn't apply #1885
With directory environments (#1660, #1693), the working directory selects the environment that a debug adapter's process gets, such as the tools of a mise.toml or an .envrc. A DAP configuration created from a file keeps the project's directory as its working directory, so a file in a subdirectory with an environment of its own, as useEnv/test.js with useEnv/mise.toml in #1660, runs with the project's tools unless the user sets the working directory to the subdirectory.
How it happens
DAPConfigurationFactory.createTemplateConfiguration sets the working directory of the template to the project's directory.
DebugAdapterDescriptorFactory.prepareConfiguration, which a configuration created from a file goes through, sets the file but not the working directory.
Why it isn't a one-line change
The working directory is also the launch configuration's ${workspaceFolder} (LaunchUtils.getDapParameters passes it to the LaunchContext). Defaulting it to the file's directory would change what ${workspaceFolder} resolves to, for instance for paths that launch configurations give relative to it.
Possible direction
Default the working directory of a configuration created from a file to the file's directory, while ${workspaceFolder} stays the project's directory, for instance by resolving it from the project rather than from the working directory. Until then, #1693 documents that the working directory selects the environment.
@angelozerr before I put up a PR for this, which behavior do you want for a DAP configuration created from a file?
Keep the project's directory as its working directory, as today. feat: support directory environment variables #1693 documents that the working directory selects the environment, so a file in a subdirectory with its own mise.toml needs its working directory set by hand.
Default the working directory to the file's directory, and resolve ${workspaceFolder} from the project instead of from the working directory. A file then gets its own directory's environment, and launch configurations keep the same ${workspaceFolder} as today.
Default the working directory to the file's directory, and keep ${workspaceFolder} as the working directory. This is simpler, but it changes what ${workspaceFolder} resolves to for every configuration created from a file in a subdirectory, for instance for paths that launch configurations give relative to it.
I'd go with 2. It only changes configurations created after the change; existing ones keep their working directory.
@angelozerr Coming back to my question above, before I put up a PR: which behaviour do you want for a DAP configuration created from a file? In short:
Keep the project's directory as its working directory, as today. A file in a subdirectory with its own mise.toml or .envrc then needs its working directory set by hand.
Default the working directory to the file's directory, and resolve ${workspaceFolder} from the project. The file gets its own directory's environment, and launch configurations keep the same ${workspaceFolder} as today.
Default the working directory to the file's directory, and keep ${workspaceFolder} as the working directory. This is simpler, but it changes ${workspaceFolder} for every configuration created from a file in a subdirectory.
I'd go with 2. Only configurations created after the change are affected; existing ones keep their working directory.
Activity
lagergren commentedon Nov 7, 2026
@angelozerr before I put up a PR for this, which behavior do you want for a DAP configuration created from a file?
mise.tomlneeds its working directory set by hand.${workspaceFolder}from the project instead of from the working directory. A file then gets its own directory's environment, and launch configurations keep the same${workspaceFolder}as today.${workspaceFolder}as the working directory. This is simpler, but it changes what${workspaceFolder}resolves to for every configuration created from a file in a subdirectory, for instance for paths that launch configurations give relative to it.I'd go with 2. It only changes configurations created after the change; existing ones keep their working directory.
lagergren commentedon Nov 23, 2026
@angelozerr Coming back to my question above, before I put up a PR: which behaviour do you want for a DAP configuration created from a file? In short:
mise.tomlor.envrcthen needs its working directory set by hand.${workspaceFolder}from the project. The file gets its own directory's environment, and launch configurations keep the same${workspaceFolder}as today.${workspaceFolder}as the working directory. This is simpler, but it changes${workspaceFolder}for every configuration created from a file in a subdirectory.I'd go with 2. Only configurations created after the change are affected; existing ones keep their working directory.
fix: a DAP configuration created from a file starts in the file's dir…