In this guide, Iāll show you how to stop the History restored message from appearing in the integrated Git Bash terminal in VS Code.
But first, letās understand why and when this message appears.
š„ Prefer a video instead? Check this out:
Terminal Session & History
The History restored message is shown when the terminal restores its history after reopening a session.
In other words, during a session, you ran the git status
command, for example, and at the end of the session, you closed the VS Code while Git Bash remained open (it wasnāt terminated/killed). The next time you open VS Code, Git Bash will display the message History restored, along with the commands and their outputs from the previous session.
The history can be useful for tracking the commands youāve run and their results.
However, the history and the History restored message are often unnecessary in most cases.
Letās see how we can make it stop showing up š§¹
Stop āHistory restoredā Message From Appearing
To open the Settings, press CTRL
+ ,
(comma), or navigate to File > Preferences > Settings.
In the Settings search bar, look for Terminal > Integrated: Enable Persistent Sessions and toggle it off.
You can also change this setting by adding the following line of code to the settings.json
file:
"terminal.integrated.enablePersistentSessions": false,
After making this change, the next time you open VS Code, the History restored message will no longer appear.
ā However, the command history will also be cleared. This happens because disabling the Persistent Sessions prevents VS Code from storing any session history.
Unfortunately, I couldnāt find a way to hide the History restored message while still keeping the history.
So if you want to keep the history, itās best to stick with the default settings and simply ignore the History restored message š
Let me know what you think about this article in the comments section below.
If you find this article helpful, please share it with others and subscribe to the blog to support me, and receive a bi-monthly-ish e-mail notification on my latest articles.