File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ const TerminalPage: FC = () => {
55
55
// a round-trip, and must be a UUIDv4.
56
56
const reconnectionToken = searchParams . get ( "reconnect" ) ?? uuidv4 ( ) ;
57
57
const command = searchParams . get ( "command" ) || undefined ;
58
+ const containerName = searchParams . get ( "container" ) || undefined ;
59
+ const containerUser = searchParams . get ( "container_user" ) || undefined ;
58
60
// The workspace name is in the format:
59
61
// <workspace name>[.<agent name>]
60
62
const workspaceNameParts = params . workspace ?. split ( "." ) ;
@@ -234,6 +236,8 @@ const TerminalPage: FC = () => {
234
236
command ,
235
237
terminal . rows ,
236
238
terminal . cols ,
239
+ containerName ,
240
+ containerUser ,
237
241
)
238
242
. then ( ( url ) => {
239
243
if ( disposed ) {
@@ -302,6 +306,8 @@ const TerminalPage: FC = () => {
302
306
workspace . error ,
303
307
workspace . isLoading ,
304
308
workspaceAgent ,
309
+ containerName ,
310
+ containerUser ,
305
311
] ) ;
306
312
307
313
return (
Original file line number Diff line number Diff line change @@ -7,13 +7,21 @@ export const terminalWebsocketUrl = async (
7
7
command : string | undefined ,
8
8
height : number ,
9
9
width : number ,
10
+ containerName : string | undefined ,
11
+ containerUser : string | undefined ,
10
12
) : Promise < string > => {
11
13
const query = new URLSearchParams ( { reconnect } ) ;
12
14
if ( command ) {
13
15
query . set ( "command" , command ) ;
14
16
}
15
17
query . set ( "height" , height . toString ( ) ) ;
16
18
query . set ( "width" , width . toString ( ) ) ;
19
+ if ( containerName ) {
20
+ query . set ( "container" , containerName ) ;
21
+ }
22
+ if ( containerName && containerUser ) {
23
+ query . set ( "container_user" , containerUser ) ;
24
+ }
17
25
18
26
const url = new URL ( baseUrl || `${ location . protocol } //${ location . host } ` ) ;
19
27
url . protocol = url . protocol === "https:" ? "wss:" : "ws:" ;
You can’t perform that action at this time.
0 commit comments