mirror of https://git.tuxpa.in/a/code-server.git
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:
parent
7e05ca09bb
commit
f4ca41329a
|
@ -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",
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue