File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { CertificateError } from "./error"
8
8
import { Storage } from "./storage"
9
9
import { AuthorityPrefix , toSafeHost } from "./util"
10
10
import { OpenableTreeItem } from "./workspacesProvider"
11
+ import path from "node:path"
11
12
12
13
export class Commands {
13
14
// These will only be populated when actively connected to a workspace and are
@@ -422,8 +423,15 @@ export class Commands {
422
423
vscode . commands . executeCommand ( "workbench.action.toggleMaximizedPanel" )
423
424
// If workspace_name is provided, run coder ssh before the command
424
425
if ( app . workspace_name ) {
425
- terminal . sendText ( `coder ssh ${ app . workspace_name } ` )
426
- // Sleep for 5 seconds
426
+ let url = this . storage . getUrl ( )
427
+ if ( ! url ) {
428
+ throw new Error ( "No coder url found for sidebar" ) ;
429
+ }
430
+ let binary = await this . storage . fetchBinary ( this . restClient , toSafeHost ( url ) )
431
+ const escape = ( str : string ) : string => `"${ str . replace ( / " / g, '\\"' ) } "`
432
+ terminal . sendText ( `${ escape ( binary ) } ssh --global-config ${ escape (
433
+ path . dirname ( this . storage . getSessionTokenPath ( toSafeHost ( url ) ) ) ,
434
+ ) } ${ app . workspace_name } `)
427
435
await new Promise ( ( resolve ) => setTimeout ( resolve , 5000 ) )
428
436
terminal . sendText ( app . command )
429
437
} else {
Original file line number Diff line number Diff line change 1594
1594
1595
1595
" coder@https://github.com/coder/coder#main " :
1596
1596
version "0.0.0"
1597
- resolved "https://github.com/coder/coder#3a243c111b9abb5c38328169ff70064025bbe2fe "
1597
+ resolved "https://github.com/coder/coder#2efb8088f4d923d1884fe8947dc338f9d179693b "
1598
1598
1599
1599
collapse-white-space@^1.0.2 :
1600
1600
version "1.0.6"
You can’t perform that action at this time.
0 commit comments