🐛 Fix repeated CWD entries when creating new terminal in multi-root workspace #153204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #153125
Tests to verify the correct dropping of repeated CWDs were added.
In the screenshot:
dir-a/.vscode/settings.json
, the CWD fordir-a
is set to../dir-b
. Due to this,dir-a
was dropped from the picker list.dir-d/.vscode/settings.json
, the CWD fordir-d
is set to..
(parent directory). Since just showingdir-d
and its path in the picker makes no sense to the user, it is shown with an "(Overridden)" indicator followed by the actual CWD to clarify the user.Since the
PICK_WORKSPACE_FOLDER_COMMAND
is a general-purpose functionality which is used in different places, I opted to locally implement the picker within the terminal module.@Tyriar Although the fix seems to work, there are two other instances in the codebase where the CWD picker does not respect the
terminal.integrated.cwd
parameter. Please check these and tell me whether to fix them.terminalActions.ts#L62:
terminalActions.ts#L2453: