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
Remember/Restore multiple projects #17
Comments
I like the idea, but I'm not sure if this is going to be possible to do. From what I can tell Atom handles separate windows almost like separate applications, so I have no way of knowing whether you are closing the window or closing the application. The way that I can think of solving this (which I don't believe is possible at the time), would be to save the open projects whenever you open/close a project, and do nothing when you close the application with If you have any ideas or interest in implementing them, let me know or send a pull request/update the issue with some useful information! |
I've been rolling this around in my head, too. I was imagining an algorithm something like this (and some of these things won't directly be possible, but I think it could be the right track) - On Quit, do:If there is no flag file, add a flag file, truncate the save file to zero bytes. Now, as each atom 'process' (window?) closes, it follows the above algorithm. Thus it should write the save data to the file, and exit (without closing the file?! Not sure). The end result is a save-file with all of the current open workspaces as Atom was quit. On Reopen:Open the save file. For each entry, open that project. Once all of the files are open, delete the flag file. So, I guess - if you just 'close' one of the windows - you don't do anything. Another thing to note is that you might be able to wrap the 'flag' and the 'save-file' into just one logical file; not sure. A problem with this setup would be that, in the event of a crash, you get nothing. That would suck. If this sounds like a direction that might work, let me know. I don't know anything about developing for Atom, but I'm a pretty seasoned coffeescript developer and should be able to at least take a rough swing at it to get started. |
My thoughtsI think they're pretty similar, but here's my thoughts after reading your's. SavingI think open projects could just be saved in Json Version 1The json could just contain a list of open projects that have a key of their path and contain a time value since the last closing. If the project is still open, exclude the time since last closing.
Json Version 2Or, it could just be a map with a key of the project and a value of the time since closed. The time is just undefined if the project is open.
On open
By only reopening projects if they all contain a On close
SettingsEverything should be optional, including this feature. How long after a project has closed to be considered open should also be an option. The location of the Developing for AtomAtom has a pretty simple API, I've never used CoffeeScript before this project, so it was all new to me and I picked it up pretty quickly. The documentation is fairly good, and there is a nice guide for building a simple Atom package. Anyway, let me know what you think. |
Yea, this is huge. The plugin is frankly incomplete until all open projects can be restored. |
Here's another thought I had - you can make it even simpler, perhaps - Every time you open a project, you append that to the re-opening file. On crash or quit - just read that file and open those projects. The problem - in my cursory examination - looked like it was going to be hard to hook in to the close-button on the window, and the close project menu item in the menus. You'd basically want to override those, right? Everything else might stay the same. |
It would be nice to have it that simple, but the problem with that is there is no way that I've found to tell whether you're closing a project or closing Atom itself. I suppose hooking into the UI buttons to close projects would work, but like you said, that's not an easy task to do. Also if you did this on open, than each project that is opened, will try to open all the projects that are saved in that file. We don't want that to happen. |
I think https://github.com/norio-nomura/restore-windows claims to do this ... perhaps some clues in there |
Looks like it works pretty similar to what's been said on here previously. I think we have the ability to do it, I just don't have the time for it right now unfortunately. |
+1 having this feature! |
Now with version 0.182 of Atom feature of multiple projects became necessary (Multi root in one window) |
Agreed, would love to have this work properly with the Atom feature of multiple root folders in the same window. It only re-opens one of the root folders. |
This should be in Atom core now. |
This feature is still not working in Atom latest build on Windows and Linux. It only works in OSX. |
I thought so too, but after deleting all atom files and installing atom again - it works for me on Linux and Windows |
I had two 'projects' open at the same time - windows each with an array of tabs. When I quit and relaunched Atom, only the frontmost window was restored.
So I tend to have multiple projects open at the same time. So I am very excited to get this functionality back that I miss from Sublime Text!!! (I, in fact, continue to run Sublime just to have the Untitled File support. Perhaps no longer, now that I've found this!).
Here's how I was able to reproduce the issue -
Then quit, and re-launch Atom. Only the folder2 'project' will be reopened.
The text was updated successfully, but these errors were encountered: