File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { Workspace } from "coder/site/src/api/typesGenerated";
4
4
import * as vscode from "vscode" ;
5
5
import { FeatureSet } from "../featureSet" ;
6
6
import { getGlobalFlags } from "../globalFlags" ;
7
+ import { escapeCommandArg } from "../util" ;
7
8
import { errToStr , createWorkspaceIdentifier } from "./api-helper" ;
8
9
import { CoderApi } from "./coderApi" ;
9
10
@@ -36,7 +37,9 @@ export async function startWorkspaceIfStoppedOrFailed(
36
37
startArgs . push ( ...[ "--reason" , "vscode_connection" ] ) ;
37
38
}
38
39
39
- const startProcess = spawn ( binPath , startArgs , { shell : true } ) ;
40
+ // { shell: true } requires one shell-safe command string, otherwise we lose all escaping
41
+ const cmd = `${ escapeCommandArg ( binPath ) } ${ startArgs . join ( " " ) } ` ;
42
+ const startProcess = spawn ( cmd , { shell : true } ) ;
40
43
41
44
startProcess . stdout . on ( "data" , ( data : Buffer ) => {
42
45
data
You can’t perform that action at this time.
0 commit comments