Skip to content

Commit c3bd176

Browse files
Merge pull request #141 from gjsjohnmurray/fix-124
Reuse session-cached username if server definition lacks one
2 parents 388b423 + d936a12 commit c3bd176

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/api/getServerSpec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ export async function getServerSpec(name: string, scope?: vscode.ConfigurationSc
4242
}
4343
else {
4444

45-
// Obtain a username (including blank to try connecting anonymously)
45+
// Use cached username if appropriate
46+
if (!server.username && credentialCache[name]) {
47+
server.username = credentialCache[name].username;
48+
}
49+
50+
// Prompt for a username if necessary (including blank to try connecting anonymously)
4651
if (!server.username) {
4752
await vscode.window
4853
.showInputBox({

0 commit comments

Comments
 (0)