Change:
My project is under https://user- Reproduce steps: vscode open a folder which file path contains space, for example: an integrated terminal the path link Versions:
nice I can repro with the space in the name, thanks for following up
I can still repro with Windows.
I looked into this, and it will be tricky because we currently use space as one of the characters which indicates the end of a path. One idea would be to check if such a link exists (using our original regex) and if not, use regex on the subsequent sequence - then concatenating the two results for First result would be doesn't exist process exists
https://user- Look the above video, I have several questions. path is not a existed path in the disk, but also clickable. I click the , it open a file which is not why the whole string is recogonized to a path? the real path is:
this is actually about when the parents of the link have a space, it's expected currently that an absolute path with a space won't work.
is it expected that a local link with a space somewhere within the path is not detected? that is the case currently - verified via adding a test to
absolute paths (eg. ) won't work because of Relative paths without spaces with absolute ancestors that have spaces (eg. inside ) should work but don't in some cases.
When verifying, make sure to test both on a Windows machine and a non-Windows machine.
Doesn't work for me on a Mac, I guess thats probably because I still haven't got the fix in the latest insider build.
are you on ?
Worked for me on macOS. Don't have a Windows machine to try this out so someone else will need to verify on Windows.
Yes, I'm on that same version. Here's what it looks like for me on a Mac with spaces !
still not work in latest version: https://user-
For absolute paths, see I wasn't able to get to work, though. It'd open the file, but place the cursor at the beginning.
please provide some more details, it works for me: !
This is the behaviour with version 1.70.0 After ctrl+clik a popup appears at the top of the screen and I have to hit enter to go to the suggested file:line.
I can repro that on Windows, Remote-WSL and macOS. The file must not be in the root directory for this to happen. !
let's track that problem in and as this issue is becoming quite unwieldy/unfocused.
created to track the problem related to quotes you're seeing. Could you re-verify this if all good outside of these 3 issues I created? It's difficult to manage this issue as it's so general.

Discussion:
* * @param link Url link which may contain line and column number. */ <del> extractLineColumnInfo(link: string, uri?: URI): ILineColumnInfo { </del> <ins> extractLineColumnInfo(link: string, uri: URI): ILineColumnInfo { </ins> const lineColumnInfo: ILineColumnInfo = { lineNumber: 1, columnNumber: 1 }; <del> // If a URI was passed in the exact file is known, sanitize the link text such that the // folders and file name do not contain whitespace. The actual path isn't important in // extracting the line and column from the regex so this is safe if (uri) { const fileName = basename(uri.path); const index = link.indexOf(fileName); const endIndex = index + fileName.length; link = link.slice(0, endIndex).replace(/s/g, '_') + link.slice(endIndex); } </del> <ins> // Calculate the file name end using the URI if possible, this will help with sanitizing the // link for the match regex. The actual path isn't important in extracting the line and // column from the regex so modifying the link text before the file name is safe. const fileName = basename(uri.path); const index = link.indexOf(fileName); const fileNameEndIndex: number = index !== -1 ? index + fileName.length : link.length; // Sanitize the link text such that the folders and file name do not contain whitespace. link = link.slice(0, fileNameEndIndex).replace(/s/g, '_') + link.slice(fileNameEndIndex); </ins> // The local link regex only works for non file:// links, check these for a simple // `:line:col` suffix

const { uri, isDirectory } = result; const linkToOpen = { // Use the absolute URI's path here so the optional line/col get detected <del> text: result.uri.fsPath + (text.match(/:d+(:d+)?$/)?.[0] || ''), </del> <ins> text: result.uri.path + (text.match(/:d+(:d+)?$/)?.[0] || ''), </ins> uri, bufferRange: link.bufferRange, type: link.type

}); }); <del> test.skip('should extract line and column from links in a workspace containing spaces', async () => { localFileOpener = instantiationService.createInstance(TerminalLocalFileLinkOpener, OperatingSystem.Linux); const localFolderOpener = instantiationService.createInstance(TerminalLocalFolderInWorkspaceLinkOpener); opener = instantiationService.createInstance(TerminalSearchLinkOpener, capabilities, Promise.resolve('/space folder'), localFileOpener, localFolderOpener, OperatingSystem.Linux); fileService.setFiles([ URI.from({ scheme: Schemas.file, path: '/space folder/foo/bar.txt' }) ]); await opener.open({ text: './foo/bar.txt:10:5', bufferRange: { start: { x: 1, y: 1 }, end: { x: 8, y: 1 } }, type: TerminalBuiltinLinkType.Search }); deepStrictEqual(activationResult, { link: 'file:///space%20folder/foo/bar.txt', source: 'editor', selection: { startColumn: 5, startLineNumber: 10 }, }); }); </del> suite('macOS/Linux', () => { setup(() => { localFileOpener = instantiationService.createInstance(TerminalLocalFileLinkOpener, OperatingSystem.Linux);

source: 'search' }); }); <ins> test('should extract line and column from links in a workspace containing spaces', async () => { localFileOpener = instantiationService.createInstance(TerminalLocalFileLinkOpener, OperatingSystem.Linux); const localFolderOpener = instantiationService.createInstance(TerminalLocalFolderInWorkspaceLinkOpener); opener = instantiationService.createInstance(TerminalSearchLinkOpener, capabilities, Promise.resolve('/space folder'), localFileOpener, localFolderOpener, OperatingSystem.Linux); fileService.setFiles([ URI.from({ scheme: Schemas.file, path: '/space folder/foo/bar.txt' }) ]); await opener.open({ text: './foo/bar.txt:10:5', bufferRange: { start: { x: 1, y: 1 }, end: { x: 8, y: 1 } }, type: TerminalBuiltinLinkType.Search }); deepStrictEqual(activationResult, { link: 'file:///space%20folder/foo/bar.txt', source: 'editor', selection: { startColumn: 5, startLineNumber: 10 }, }); }); </ins> }); suite('Windows', () => {

source: 'search' }); }); <ins> test('should extract line and column from links in a workspace containing spaces', async () => { localFileOpener = instantiationService.createInstance(TerminalLocalFileLinkOpener, OperatingSystem.Windows); const localFolderOpener = instantiationService.createInstance(TerminalLocalFolderInWorkspaceLinkOpener); opener = instantiationService.createInstance(TerminalSearchLinkOpener, capabilities, Promise.resolve('/space folder'), localFileOpener, localFolderOpener, OperatingSystem.Windows); fileService.setFiles([ URI.from({ scheme: Schemas.file, path: '/space folder/foo/bar.txt' }) ]); await opener.open({ text: './foo/bar.txt:10:5', bufferRange: { start: { x: 1, y: 1 }, end: { x: 8, y: 1 } }, type: TerminalBuiltinLinkType.Search }); deepStrictEqual(activationResult, { link: 'file:///space%20folder/foo/bar.txt', source: 'editor', selection: { startColumn: 5, startLineNumber: 10 }, }); await opener.open({ text: '.foobar.txt:10:5', bufferRange: { start: { x: 1, y: 1 }, end: { x: 8, y: 1 } }, type: TerminalBuiltinLinkType.Search }); deepStrictEqual(activationResult, { link: 'file:///space%20folder/foo/bar.txt', source: 'editor', selection: { startColumn: 5, startLineNumber: 10 }, }); }); </ins> }); }); });