Change:
<!-- 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.75.1 OS Version: Windows 11 Steps to Reproduce: a link in the terminal of the form the link would be automatically detected correctly and made clickable (although in the debug tab, by contrast, it was not detected properly). version 1.75.0, the link detection wrongly terminates at the so the link cannot be easily clicked to open it. I appreciate that you can never please all the people all the time with URL guessing, but I thought it was worth mentioning given that it used to work fine, and to be fair all the characters , and are standard normal URL code points and always have been.
Can repro after, not before: !
This is actually a regression in monaco's link detection which the terminal leverages for uris: 74: <img width="259" alt="image" src="https://user-"75: ! So this was unrelated to the recent terminal link improvements which focused on file detection
introduced this change to fix
Commas are used pretty often in certain links, not sure how advanced the detection is but it could be improved by only treating it as a separator if after a / or if the word before has a period?
GitHub also doesn't split at comma: , I'd probably revert the fix, but I'm fine with either. Up to you
This issue doesn't just affect the links in the terminal. It also applies to , and files (and maybe more). VS Code Version: 1.75.1 OS Version: Windows 10 Steps to reproduce: a file and paste the following code into it: an file and paste the following url into it: . both cases the link detection wrongly terminates at the so the link cannot be easily clicked to open it.
:+1: I'm OK to revert.

Discussion:
_classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None); // allow-any-unicode-next-line <del> const FORCE_TERMINATION_CHARACTERS = ', t<>'"、。｡､，．：；‘〈「『〔（［｛｢｣｝］）〕』」〉’｀～…'; </del> <ins> const FORCE_TERMINATION_CHARACTERS = ' t<>'"、。｡､，．：；‘〈「『〔（［｛｢｣｝］）〕』」〉’｀～…'; </ins> for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), CharacterClass.ForceTermination); } <del> const CANNOT_END_WITH_CHARACTERS = '.;:'; </del> <ins> const CANNOT_END_WITH_CHARACTERS = '.,;:'; </ins> for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) { _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), CharacterClass.CannotEndIn); }

return computeLinks(target); } <del> function extractLinks(text: string): string { const keep: boolean[] = []; const links = myComputeLinks([text]); for (const link of links) { const startChar = link.range.startColumn - 1; const endChar = link.range.endColumn - 1; for (let char = startChar; char < endChar; char++) { keep[char] = true; </del> <ins> function assertLink(text: string, extractedLink: string): void { let startColumn = 0, endColumn = 0, chr: string, i = 0; for (i = 0; i < extractedLink.length; i++) { chr = extractedLink.charAt(i); if (chr !== ' ' && chr !== 't') { startColumn = i + 1; break; </ins> } } <del> const result: string[] = []; for (let i = 0; i < text.length; i++) { if (keep[i]) { result.push(text.charAt(i)); } else { result.push(' '); </del> <ins> for (i = extractedLink.length - 1; i >= 0; i--) { chr = extractedLink.charAt(i); if (chr !== ' ' && chr !== 't') { endColumn = i + 2; break; </ins> } } <del> return result.join(''); } function assertLink(text: string, expectedLinks: string): void { assert.deepStrictEqual(extractLinks(text), expectedLinks); </del> <ins> const r = myComputeLinks([text]); assert.deepStrictEqual(r, [{ range: { startLineNumber: 1, startColumn: startColumn, endLineNumber: 1, endColumn: endColumn }, url: extractedLink.substring(startColumn - 1, endColumn - 1) }]); </ins> } suite('Editor Modes - Link Computer', () => {

assertLink( '(see http://foo.bar)', <del> '     http://foo.bar ' </del> <ins> '     http://foo.bar  ' </ins> ); assertLink( '[see http://foo.bar]', <del> '     http://foo.bar ' </del> <ins> '     http://foo.bar  ' </ins> ); assertLink( '{see http://foo.bar}', <del> '     http://foo.bar ' </del> <ins> '     http://foo.bar  ' </ins> ); assertLink( '<see http://foo.bar>', <del> '     http://foo.bar ' </del> <ins> '     http://foo.bar  ' </ins> ); assertLink( '<url>http://mylink.com</url>',

test('issue #62278: "Ctrl + click to follow link" for IPv6 URLs', () => { assertLink( 'let x = "http://[::1]:5000/connect/token"', <del> '         http://[::1]:5000/connect/token ' </del> <ins> '         http://[::1]:5000/connect/token  ' </ins> ); });

`                                   https://github.com/jeff-hykin/better-c-syntax/blob/master/autogenerated/c.tmLanguage.json  `, ); }); <del> test('issue #119696: Links shouldn't include commas', () => { assertLink( `https://apod.nasa.gov/apod/ap170720.html,IC 1396: Emission Nebula in Cepheus,https://apod.nasa.gov/apod/image/1707/MOSAIC_IC1396_HaSHO_blanco1024.jpg,https://apod.nasa.gov/apod/image/1707/MOSAIC_IC1396_HaSHO_blanco.jpg`, `https://apod.nasa.gov/apod/ap170720.html                                     https://apod.nasa.gov/apod/image/1707/MOSAIC_IC1396_HaSHO_blanco1024.jpg https://apod.nasa.gov/apod/image/1707/MOSAIC_IC1396_HaSHO_blanco.jpg` ); assertLink( `https://apod.nasa.gov/apod/ap180402.html,"Moons, Rings, Shadows, Clouds: Saturn (Cassini)",https://apod.nasa.gov/apod/image/1804/SaturnRingsMoons_Cassini_967.jpg,https://apod.nasa.gov/apod/image/1804/SaturnRingsMoons_Cassini_967.jpg`, `https://apod.nasa.gov/apod/ap180402.html                                                   https://apod.nasa.gov/apod/image/1804/SaturnRingsMoons_Cassini_967.jpg https://apod.nasa.gov/apod/image/1804/SaturnRingsMoons_Cassini_967.jpg`, ); }); </del> });