I had some tabs in the Terminal and was doing some work when it crashed but my processes were still running (could see them in Activity Monitor/htop). When I started the Terminal again it put me to ttys004 so I guess there are 3 more (4 if there should be a ttys000 too) sessions running.

How do I regain control over my lost sessions?


Using screen would of saved you from this, man screen for more info on screen. It's briliant for long running process.

to start screen (or any command) when you create a new window or tab, add the command to the bottom of your ~/.bash_profile. eg: screen

Here is a copy of my ~/.screenrc , you might find some useful stuff in it http://pastebin.ca/1663824 screen also allows for tabs, the above version will create two bash login tabs,

  • I checked the manual and seems to be just what I need. Do you know if there is a way to run it every time I make a new tab in Terminal.app? I tried to put it in Setting > Shell > Startup > Run command but had no luck... – Kostas Nov 9 '09 at 15:55
  • 1
    Something like tlug.dnho.net/?q=node/239 should work, with slight modifications if you are not using Bash as your login shell. – David Spillett Nov 9 '09 at 20:09
  • The first script of the post seems to not be working. The second though is really useful (with some modifications). – Kostas Nov 10 '09 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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