Skip to content

Commit 272593e

Browse files
committed
Remove open-in flag
1 parent ceb2265 commit 272593e

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"lint": "./ci/dev/lint.sh",
2727
"test": "./ci/dev/test.sh",
2828
"ci": "./ci/dev/ci.sh",
29-
"watch": "NODE_OPTIONS=--max_old_space_size=32384 ts-node ./ci/dev/watch.ts"
29+
"watch": "VSCODE_IPC_HOOK_CLI= NODE_OPTIONS=--max_old_space_size=32384 ts-node ./ci/dev/watch.ts"
3030
},
3131
"main": "out/node/entry.js",
3232
"devDependencies": {

src/node/cli.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export interface Args extends VsArgs {
4545
readonly "proxy-domain"?: string[]
4646
readonly locale?: string
4747
readonly _: string[]
48-
readonly "open-in"?: boolean
4948
readonly "reuse-window"?: boolean
5049
readonly "new-window"?: boolean
5150
}
@@ -142,7 +141,6 @@ const options: Options<Required<Args>> = {
142141
"show-versions": { type: "boolean", description: "Show VS Code extension versions." },
143142
"proxy-domain": { type: "string[]", description: "Domain used for proxying ports." },
144143

145-
"open-in": { type: "boolean", short: "oi", description: "Open file(s) or folder(s) in running instance" },
146144
"new-window": {
147145
type: "boolean",
148146
short: "n",
@@ -372,7 +370,7 @@ export async function readConfigFile(configPath?: string): Promise<Args> {
372370
logger.info(`Wrote default config file to ${humanPath(configPath)}`)
373371
}
374372

375-
if (!process.env.CODE_SERVER_PARENT_PID) {
373+
if (!process.env.CODE_SERVER_PARENT_PID && !process.env.VSCODE_IPC_HOOK_CLI) {
376374
logger.info(`Using config file ${humanPath(configPath)}`)
377375
}
378376

src/node/entry.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,13 @@ async function entry(): Promise<void> {
164164
console.log(version, commit)
165165
}
166166
process.exit(0)
167-
} else if (args["open-in"]) {
168-
if (!process.env["VSCODE_IPC_HOOK_CLI"]) {
169-
logger.error("VSCODE_IPC_HOOK_CLI missing from environment, unable to run")
170-
process.exit(1)
167+
} else if (process.env.VSCODE_IPC_HOOK_CLI) {
168+
const pipeArgs: OpenCommandPipeArgs = {
169+
type: "open",
170+
folderURIs: [],
171+
forceReuseWindow: args["reuse-window"],
172+
forceNewWindow: args["new-window"],
171173
}
172-
const pipeArgs: OpenCommandPipeArgs = { type: "open", folderURIs: [] }
173-
pipeArgs.forceReuseWindow = args["reuse-window"]
174-
pipeArgs.forceNewWindow = args["new-window"]
175174
const isDir = async (path: string): Promise<boolean> => {
176175
try {
177176
const st = await fs.stat(path)
@@ -196,7 +195,7 @@ async function entry(): Promise<void> {
196195
process.exit(1)
197196
}
198197
if (pipeArgs.folderURIs.length === 0 && (!pipeArgs.fileURIs || pipeArgs.fileURIs.length === 0)) {
199-
logger.error("open-in expects at least one file or folder argument")
198+
logger.error("Please specify least one file or folder argument")
200199
process.exit(1)
201200
}
202201
const vscode = http.request(

0 commit comments

Comments
 (0)