1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-28 13:15:25 +00:00

Add --ignore-last-opened option (#2434)

This allows bypassing the last opened behavior for certain cases where that's not desirable.

Fixes #1951
This commit is contained in:
JammSpread 2020-12-15 11:22:58 -05:00 committed by GitHub
parent 7e05ca09bb
commit f4ca41329a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -52,6 +52,7 @@ export interface Args extends VsArgs {
"proxy-domain"?: string[]
locale?: string
_: string[]
"ignore-last-opened"?: boolean
"reuse-window"?: boolean
"new-window"?: boolean
@ -171,7 +172,11 @@ const options: Options<Required<Args>> = {
"uninstall-extension": { type: "string[]", description: "Uninstall a VS Code extension by id." },
"show-versions": { type: "boolean", description: "Show VS Code extension versions." },
"proxy-domain": { type: "string[]", description: "Domain used for proxying ports." },
"ignore-last-opened": {
type: "boolean",
short: "e",
description: "Ignore the last opened directory or workspace in favor of an empty window."
},
"new-window": {
type: "boolean",
short: "n",

View File

@ -43,7 +43,7 @@ export class VscodeProvider {
options.args._ && options.args._.length > 0
? { url: path.resolve(options.args._[options.args._.length - 1]) }
: undefined,
lastVisited,
!options.args["ignore-last-opened"] ? lastVisited : undefined,
])
settings.write({