Visual Studio Codeはファイルの編集中に閉じても保存もせずに終了できてしまいます。但し、ファイルの編集の状態は保存されているので、次に起動したときには編集中のまま回復してくれます。
これは便利なのですが、編集中のファイルを他のマシンで見ようとしたときに、ファイル自体は更新されていないので、前回保存した時の状態でしか開けません。保存し忘れを防ぐためにVisual Studio Code終了時に保存していないファイルを保存するように促してもらうように設定します。
Visual Studio Codeの設定を開く
![](https://windows-podcast.com/sundayprogrammer/wp-content/uploads/2024/02/image-2.png)
設定の検索で「Hot」と入力する
![](https://windows-podcast.com/sundayprogrammer/wp-content/uploads/2024/02/image-3.png)
Hot Exitが出てくる
![](https://windows-podcast.com/sundayprogrammer/wp-content/uploads/2024/02/image-4-1024x532.png)
onExitをoffに変更する
![](https://windows-podcast.com/sundayprogrammer/wp-content/uploads/2024/02/image-5.png)
![](https://windows-podcast.com/sundayprogrammer/wp-content/uploads/2024/02/image-6.png)
Visual Studio Code終了時に保存していないファイルを保存するかメッセージが出る
![](https://windows-podcast.com/sundayprogrammer/wp-content/uploads/2024/02/image-7.png)