LoginSignup
12
11

More than 1 year has passed since last update.

VSCodeで前回開いていたフォルダを開かせないようにする

Last updated at Posted at 2021-07-20

VSCodeで前回開いていたフォルダを開かせないようにする

今回の目的は「VSCodeをまっさらな状態で起動できるようにする」です。

この設定は好みが別れると思いますが、
個人的には前回開いていたフォルダを開きたいとは限らないケースの方が多いのでOFFにしたいと思います。

前回開いていたフォルダを開かせないように設定を変更する

以下の設定をsettings.jsonに追加する。

{
    "window.openWithoutArgumentsInNewWindow": "on",
    "window.restoreWindows": "none"
}

window.restoreWindows

VSCode再起動時の挙動に関する設定でnoneにすることで何も開かないように制御できます。

公式ガイドから引用

The window.restoreWindows setting tells VS Code how to restore the opened windows of your previous session. By default, VS Code will restore all windows you worked on during your previous session (setting: all). Change this setting to none to never reopen any windows and always start with an empty VS Code instance. Change it to one to reopen the last opened window you worked on or folders to only restore windows that had folders opened.

Window management - Visual Studio Code

window.openWithoutArgumentsInNewWindow

すでにVSCodeが起動している時にVSCodeを起動した場合の挙動に関する設定のようです。

こちらの記事がとても分かりやすかったです。

VS Code 1.22 の新機能のリリースノートをしずしずと眺めてみる

12
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
11