Skip to content

Commit 9f6edab

Browse files
authored
feat: replace vscodeipc with vscodessh (#5645)
The VS Code extension has been refactored to use VS Code Remote SSH instead of using the private API. This changes the structure to continue using SSH, but output network information periodically to a file.
1 parent fa7deaa commit 9f6edab

File tree

9 files changed

+324
-650
lines changed

9 files changed

+324
-650
lines changed

agent/agent.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,18 @@ func (a *agent) createTailnet(ctx context.Context, derpMap *tailcfg.DERPMap) (_
304304
if err != nil {
305305
return
306306
}
307-
go a.sshServer.HandleConn(conn)
307+
closed := make(chan struct{})
308+
_ = a.trackConnGoroutine(func() {
309+
select {
310+
case <-network.Closed():
311+
case <-closed:
312+
}
313+
_ = conn.Close()
314+
})
315+
_ = a.trackConnGoroutine(func() {
316+
defer close(closed)
317+
a.sshServer.HandleConn(conn)
318+
})
308319
}
309320
}); err != nil {
310321
return nil, err

cli/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func Core() []*cobra.Command {
9797
update(),
9898
users(),
9999
versionCmd(),
100-
vscodeipcCmd(),
100+
vscodeSSH(),
101101
workspaceAgent(),
102102
}
103103
}

cli/ssh.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func getWorkspaceAndAgent(ctx context.Context, cmd *cobra.Command, client *coder
256256
)
257257
if shuffle {
258258
res, err := client.Workspaces(ctx, codersdk.WorkspaceFilter{
259-
Owner: codersdk.Me,
259+
Owner: userID,
260260
})
261261
if err != nil {
262262
return codersdk.Workspace{}, codersdk.WorkspaceAgent{}, err

cli/vscodeipc.go

-88
This file was deleted.

0 commit comments

Comments
 (0)