Vishal Sagar
Vishal Sagar

Reputation: 391

How to disable session restore message in vscode terminal

enter image description here

I don't want this message appearing session contents restored every time I open terminal. Why can't it restore and just doesn't show any msg or at least provide a option to do it.

Upvotes: 25

Views: 23581

Answers (3)

kibromhft
kibromhft

Reputation: 1057

This feature can be disabled using the following two lines. Open "settings" -> Enter these commands to revert the VSCode behavior. Set them to never and false.

"terminal.integrated.persistentSessionReviveProcess": "never",
"terminal.integrated.enablePersistentSessions": false

enter image description here

Upvotes: 65

VonC
VonC

Reputation: 1329672

VSCode 1.69 (June 2022) should remove that message in some instances:

See PR 152408 "Restore old buffers if no additional interactions happened" from issue 142855

This makes terminals only restore their current session's buffer if there was some interaction by the user, similar to how the initial process doesn't get revived if no interaction occurred.

That would allow to pass from:

https://user-images.githubusercontent.com/2193314/154096613-721e477b-c3c0-4fcc-9c11-75c8f460678b.png

To:

Tyriar\xterm.js  master [?]
❯

 Session contents restored from 2/15/2022 at 7:39:34 AM 

Shell integration activated!

Tyriar\xterm.js  master [?] 
❯  

Slightly less "loud".

Upvotes: 0

duydang
duydang

Reputation: 43

since there's currently no way to disable the message but keeping the functionality, executing clear command on the terminal startup is my current workaround.

for powershell, just add clear command to the profile.

Upvotes: 4

Related Questions