Merged
Conversation
mjbvz
previously approved these changes
Jan 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a terminal suggest regression where typing ../ would show completions from the grandparent directory instead of the parent directory, caused by double-navigation in cwd resolution.
Changes:
- Skip pre-resolution of paths containing
..in the extension to prevent double-navigation - Use
lastWordFolderResourceinstead ofcwdfor computing the parent directory completion item to ensure it's relative to the viewed folder - Add test coverage for
../completion behavior and update existing test expectations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
extensions/terminal-suggest/src/terminalSuggestMain.ts |
Adds check to skip pre-resolving paths containing .. segments to avoid double-navigation |
src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalCompletionService.ts |
Changes parent directory completion to use lastWordFolderResource instead of cwd for correct relative navigation |
src/vs/workbench/contrib/terminalContrib/suggest/test/browser/terminalCompletionService.test.ts |
Adds test for ../ completions and updates test expectation for ./test/../ path normalization |
karthiknadig
approved these changes
Jan 13, 2026
meganrogge
added a commit
that referenced
this pull request
Jan 13, 2026
meganrogge
added a commit
that referenced
this pull request
Jan 13, 2026
eli-w-king
pushed a commit
that referenced
this pull request
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #287161
cc @Tyriar
The bug was caused by double-navigation when typing
../:resolveCwdFromCurrentCommandString()was pre-resolving../paths, settingcwdto the parent directory../, it didURI.joinPath(cwd, '../')which navigated up AGAIN from the already-resolved parentSo typing
../fromvscoderesulted in:Repos(parent)joinPath(parent, '../')=meganrogge(grandparent)Reposinstead ofxterm.jsAdded a check in
resolveCwdFromCurrentCommandStringto skip pre-resolution for paths containing..to fix this.