Skip to content

Commit b20d9c4

Browse files
committed
🔨 Use RegExp to ensure correct URL format
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent 406c410 commit b20d9c4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,7 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
432432

433433
const [command] = data.split(';');
434434

435-
// We need to manually make sure the given URI is not merely `file://` because The `URI.parse` handles it
436-
// exactly as it handles `file:///` (which is a valid URI for us here).
437-
if (command.startsWith('file://') && command.length > 7) {
435+
if (command.match(/^file:\/\/.*\//)) {
438436
const uri = URI.parse(command);
439437
if (uri.path && uri.path.length > 0) {
440438
this._updateCwd(uri.path);

0 commit comments

Comments
 (0)