Skip to content

Hide History Restored Message in VS Code Terminal

Hide History restored message in VS Code Terminal

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.

VS Code Enable Persistent Sessions setting

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.   
  

Comments