未验证 提交 f4ca4132 编写于 作者: J JammSpread 提交者: GitHub

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

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

Fixes #1951
上级 7e05ca09
......@@ -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({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册