-
-
Notifications
You must be signed in to change notification settings - Fork 26k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for OS X Lion's restore windows after quit #522
Conversation
By default, Lion's Terminal.app will re-open all windows after quitting and restarting the app, but only in bash using a chpwd hook found in /etc/bashrc. See also http://superuser.com/questions/313650/resume-zsh-terminal-os-x-lion
I found this via the superuser.com link. I tried the patch in this pull request in my own zshrc, but it didn't work on my Lion zsh 4.3.11. I had to made the following changes:
ie: replace "Apple Terminal" with "Apple_Terminal", and change the use of braces to "then / fi" Any thoughts? Is this just because I'm not using oh-my-zsh? |
Apparently I can neither type accurately, nor remember the subtleties of the zsh "if" statement. |
No problem, I don't really know what I'm doing when I'm programming zsh either :-) |
I just started using ohmyzsh today and it's amazing! I've thrown out my old hacky scripts. Hopefully this will get merged soon and it will be damn near perfect! |
Is it me or is this functionality now available on Lion in master without the contents of this pull request? (This is showing as open, so I assume it wasn't merged) |
Doesn't work for me in robbyrussell/master (be2ab22) Is it possible you tried the rgm/master fork? I have merged it in there. I have to maintain it in a separate branch for the pull request, since my master doesn't cleanly merge to robbyrussell/master right now. |
Apparently I was imagining it :-S I just checked and it's not re-opening the directories. Sorry for the noise! Hopefully this will get merged soon, as when I re-open Terminal on Lion I have to press just to see the prompt |
The OS X plugin is not the proper place to put this. It needs to go where the terminal window and tab titles are set; otherwise, you'll get duplicates. I've taken care of this in my extensive rewrite of OMZ. I wonder why you have added all those authors in the header. I haven't used any of their code. |
Clearly, I should have read the actual Would you educate me a little more on this point? I'm having trouble finding where the Lion resume code is in your fork. I'm sure it could be improved, but this patch has been working OK for me. |
I have not pushed yet. :) Here's the snippet.
This has nothing to do with resume per se. It's just how Terminal.app is informed of the address of the current working directory. When it knows the current working directory, Terminal.app lets you open Finder windows from the title bar and resume to the previous working directory. |
Ah, OK. Where would you stick this, |
No, this is just an incomplete snippet. My OMZ fork has been heavily rewritten in relation to #377. I'm almost done, just a few more rebases, and I'll announce it. |
OK. Looking forward to it. |
@ashmoran said:
I am having this issue as well. As someone new to zsh as well, these two problems lead me to spend a few hours trying to figure out what I could have possibly misconfigured. Thankfully it seems like @sorin-ionescu is almost done with the rewrite. |
By default, Lion's Terminal.app will re-open all windows after quitting and
restarting the app, but only in bash using a chpwd hook found in /etc/bashrc.
See also http://superuser.com/questions/313650/resume-zsh-terminal-os-x-lion