Fix PowerShell terminal link detection for paths with spaces (#254504)

This commit is contained in:
Copilot 2025-07-09 18:50:18 +02:00 committed by GitHub
parent 34d2ec438c
commit ba25f9cd4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -52,8 +52,8 @@ const fallbackMatchers: RegExp[] = [
// C:\foo/bar baz:339: error ...
// C:\foo/bar baz:339:12: error ... [#178584, Clang]
/^(?<link>(?<path>.+):(?<line>\d+)(?::(?<col>\d+))?) ?:/,
// Cmd prompt
/^(?<link>(?<path>.+))>/,
// PowerShell and cmd prompt
/^(?:PS\s+)?(?<link>(?<path>[^>]+))>/,
// The whole line is the path
/^ *(?<link>(?<path>.+))/
];

View File

@ -158,6 +158,8 @@ const supportedFallbackLinkFormats: LinkFormatInfo[] = [
{ urlFormat: '{0}:{1}:{2} :', line: '5', column: '3', linkCellEndOffset: -2 },
{ urlFormat: '{0}:{1}:', line: '5', linkCellEndOffset: -1 },
{ urlFormat: '{0}:{1}:{2}:', line: '5', column: '3', linkCellEndOffset: -1 },
// PowerShell prompt
{ urlFormat: 'PS {0}>', linkCellStartOffset: 3, linkCellEndOffset: -1 },
// Cmd prompt
{ urlFormat: '{0}>', linkCellEndOffset: -1 },
// The whole line is the path