Mac – Restore Terminal Tabs with Session History

bashterminaltime-machine

I had a Terminal window with 7 or 8 tabs with a lot of history and long scrollback, with resume set to 10000 rows, that was always persisting between sessions. I have accidentally closed the window instead of quitting the Terminal app and I have lost this setup. I have a time machine backup from the day before. Is there a way to restore my tabs with their histories?

I have found these two possibly related Q&A, but I can’t figure out how to use that info to restore my tabs:

Best Answer

The saved state of Terminal is stored in this folder.

~/Library/Saved Application State/com.apple.Terminal.savedState/

Quit Terminal, copy the contents of this folder from your backup, then open Terminal.