Allow opening files, folders, and workspaces in existing code-server from CLI (#1994)

Add initial support for opening files / folders in running code-server instance.

Current limitations:

- unable to open a file in a new window, only folders
- unable to use addMode feature
- others...
This commit is contained in:
shayne
2020-08-27 11:06:21 -07:00
committed by GitHub
parent 221e95ee89
commit ceb2265b14
3 changed files with 151 additions and 70 deletions

View File

@ -45,6 +45,9 @@ export interface Args extends VsArgs {
readonly "proxy-domain"?: string[]
readonly locale?: string
readonly _: string[]
readonly "open-in"?: boolean
readonly "reuse-window"?: boolean
readonly "new-window"?: boolean
}
interface Option<T> {
@ -139,6 +142,18 @@ const options: Options<Required<Args>> = {
"show-versions": { type: "boolean", description: "Show VS Code extension versions." },
"proxy-domain": { type: "string[]", description: "Domain used for proxying ports." },
"open-in": { type: "boolean", short: "oi", description: "Open file(s) or folder(s) in running instance" },
"new-window": {
type: "boolean",
short: "n",
description: "Force to open a new window. (use with open-in)",
},
"reuse-window": {
type: "boolean",
short: "r",
description: "Force to open a file or folder in an already opened window. (use with open-in)",
},
locale: { type: "string" },
log: { type: LogLevel },
verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." },