Skip to content

Commit 4373424

Browse files
authored
Force new window for remote -> local Continue On (microsoft#187301)
Force new window for remote -> local clone
1 parent e954d50 commit 4373424

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

extensions/git/src/commands.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,15 +750,22 @@ export class CommandCenter {
750750

751751
if (uri !== undefined) {
752752
// Launch desktop client if currently in web
753+
let target = `${env.uriScheme}://vscode.git/clone?url=${encodeURIComponent(uri)}`;
753754
if (env.uiKind === UIKind.Web) {
754-
let target = `${env.uriScheme}://vscode.git/clone?url=${encodeURIComponent(uri)}`;
755755
if (ref !== undefined) {
756756
target += `&ref=${encodeURIComponent(ref)}`;
757757
}
758758
return Uri.parse(target);
759759
}
760760

761-
// If already in desktop client, directly clone
761+
// If already in desktop client but in a remote window, we need to force a new window
762+
// so that the git extension can access the local filesystem for cloning
763+
if (env.remoteName !== undefined) {
764+
target += `&windowId=_blank`;
765+
return Uri.parse(target);
766+
}
767+
768+
// Otherwise, directly clone
762769
void this.clone(uri, undefined, { ref: ref });
763770
}
764771
}

0 commit comments

Comments
 (0)