Code change:
PathSeparatorClause = '/', // '":; are allowed in paths but they are often separators so ignore them // Also disallow  to prevent a catastropic backtracking case #24795 <del> ExcludedPathCharactersClause = '[^0s!`&*()[]'":;]', </del> <ins> ExcludedPathCharactersClause = '[^0s!`&*()'":;]', ExcludedStartPathCharactersClause = '[^0s!`&*()[]'":;]', </ins> WinOtherPathPrefix = '..?|~', WinPathSeparatorClause = '(|/)', <del> WinExcludedPathCharactersClause = '[^0<>?|/s!`&*()[]'":;]', </del> <ins> WinExcludedPathCharactersClause = '[^0<>?|/s!`&*()'":;]', WinExcludedStartPathCharactersClause = '[^0<>?|/s!`&*()[]'":;]', </ins> } /** A regex that matches paths in the form /foo, ~/foo, ./foo, ../foo, foo/bar */ <del> export const unixLocalLinkClause = '((' + RegexPathConstants.PathPrefix + '|(' + RegexPathConstants.ExcludedPathCharactersClause + ')+)?(' + RegexPathConstants.PathSeparatorClause + '(' + RegexPathConstants.ExcludedPathCharactersClause + ')+)+)'; </del> <ins> export const unixLocalLinkClause = '((' + RegexPathConstants.PathPrefix + '|(' + RegexPathConstants.ExcludedStartPathCharactersClause + RegexPathConstants.ExcludedPathCharactersClause + '*))?(' + RegexPathConstants.PathSeparatorClause + '(' + RegexPathConstants.ExcludedPathCharactersClause + ')+)+)'; </ins> export const winDrivePrefix = '(?:?)?[a-zA-Z]:'; /** A regex that matches paths in the form ?c:foo c:foo, ~foo, .foo, ..foo, foobar */ <del> export const winLocalLinkClause = '((' + `(${winDrivePrefix}|${RegexPathConstants.WinOtherPathPrefix})` + '|(' + RegexPathConstants.WinExcludedPathCharactersClause + ')+)?(' + RegexPathConstants.WinPathSeparatorClause + '(' + RegexPathConstants.WinExcludedPathCharactersClause + ')+)+)'; </del> <ins> export const winLocalLinkClause = '((' + `(${winDrivePrefix}|${RegexPathConstants.WinOtherPathPrefix})` + '|(' + RegexPathConstants.WinExcludedStartPathCharactersClause + RegexPathConstants.WinExcludedPathCharactersClause + '*))?(' + RegexPathConstants.WinPathSeparatorClause + '(' + RegexPathConstants.WinExcludedPathCharactersClause + ')+)+)'; </ins> // TODO: This should eventually move to the more structured terminalLinkParsing /** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160,

Related discussion:
text: <!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.71.0-insider OS Version: macOS Big Sur 11.6 Steps to Reproduce: a link in terminal containing "[" or "]" characters (ex. ) to cmd+click the link, observe that it is split on those characters. For example, links to , , , , and . In reality this is one valid path (nextjs uses "[ ]" to identify parameters in URLs) <img width="526" alt="Screen Shot 2022-09-22 at 5 12 00 PM" src="https://user-"
This works for urls: ! Not local paths: !
reported that it does (kind of) work: ! We would need to review all link detectors for this.
This happens with local links because [] are currently excluded chars: