1

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:

0

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.

  • :-( Saved Application State doesn’t appear to be part of Time Machine Backup… I guess that’s it then? – Palimondo May 23 '18 at 16:06
  • @Palimondo Oops, didn't think to check that; do you use APFS and have a snapshot you can roll back to? – grg May 23 '18 at 16:09
  • Nope, just upgraded to High Sierra yesterday and I’m still on HFS+. – Palimondo May 23 '18 at 16:10
  • So, I have now saved a copy of .bash_sessions and com.apple.Terminal.savedState in hopes that something can be done to restore the tabs. But I cannot find any keys in the windows.plist that would match some IDs from sessions. The data.data, window_1.data and window_2.data seem inscrutable at first glance, but weighing at 143 KB, 5 KB and 204 KB respectably, I’m hoping they contain the scrollback rows. Any clues about their format? – Palimondo May 23 '18 at 16:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.