Skip to content

Commit fe6d1dc

Browse files
committed
Show Remote SSH Output panel on workspace start
1 parent c1206b2 commit fe6d1dc

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/extension.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
353353
}),
354354
);
355355

356+
let shouldShowSshOutput = false;
356357
// Since the "onResolveRemoteAuthority:ssh-remote" activation event exists
357358
// in package.json we're able to perform actions before the authority is
358359
// resolved by the remote SSH extension.
@@ -370,6 +371,7 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
370371
);
371372
if (details) {
372373
ctx.subscriptions.push(details);
374+
shouldShowSshOutput = details.startedWorkspace;
373375
// Authenticate the plugin client which is used in the sidebar to display
374376
// workspaces belonging to this deployment.
375377
client.setHost(details.url);
@@ -460,9 +462,27 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
460462
}
461463
}
462464
}
465+
466+
if (shouldShowSshOutput) {
467+
showSshOutput();
468+
}
463469
}
464470

465471
async function showTreeViewSearch(id: string): Promise<void> {
466472
await vscode.commands.executeCommand(`${id}.focus`);
467473
await vscode.commands.executeCommand("list.find");
468474
}
475+
476+
function showSshOutput(): void {
477+
for (const command of [
478+
"opensshremotes.showLog",
479+
"windsurf-remote-openssh.showLog",
480+
]) {
481+
/**
482+
* We must not await this command because
483+
* 1) it may not exist
484+
* 2) it might cause the Remote SSH extension to be loaded synchronously
485+
*/
486+
void vscode.commands.executeCommand(command);
487+
}
488+
}

src/remote/remote.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { computeSSHProperties, sshSupportsSetEnv } from "./sshSupport";
5151
export interface RemoteDetails extends vscode.Disposable {
5252
url: string;
5353
token: string;
54+
startedWorkspace: boolean;
5455
}
5556

5657
export class Remote {
@@ -415,6 +416,7 @@ export class Remote {
415416
}
416417
}
417418

419+
let startedWorkspace = false;
418420
const disposables: vscode.Disposable[] = [];
419421
try {
420422
// Register before connection so the label still displays!
@@ -442,6 +444,7 @@ export class Remote {
442444
await this.closeRemote();
443445
return;
444446
}
447+
startedWorkspace = true;
445448
workspace = updatedWorkspace;
446449
}
447450
this.commands.workspace = workspace;
@@ -681,6 +684,7 @@ export class Remote {
681684
return {
682685
url: baseUrlRaw,
683686
token,
687+
startedWorkspace,
684688
dispose: () => {
685689
disposables.forEach((d) => d.dispose());
686690
},

0 commit comments

Comments
 (0)