Skip to content
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

restore terminal on restart of Atom #4

Open
trusktr opened this issue Nov 5, 2018 · 4 comments
Open

restore terminal on restart of Atom #4

trusktr opened this issue Nov 5, 2018 · 4 comments

Comments

@trusktr
Copy link

trusktr commented Nov 5, 2018

Currently it doesn't restore the terminal:

screen shot 2018-11-04 at 11 39 40 pm

(the tab is empty)

It would be sweet for terminals to be restored (at least a new terminal, but showing previous output would only be a bonus).

@PerBothner
Copy link
Owner

This is quite doable. I tried manually selecting Detach session in the contect (pop-up menu), then closing atom. Then after re-starting atom, opening manually a domterm window, I could do domterm --right attach :1 and a new window opened with old (still running session).

Atom is a bit tricky because it does a lot of save and restore automatically (like when moving windows), so figuring out when windows should be saved and when they should be closed was a bit tricky. But if I do it right, it might turn out to be trivial.

@PerBothner
Copy link
Owner

I checked in a few small fixes - it should work now.

Note you have to update both domterm and atom-domterm.

While you're re-building domterm, I'd appreciate if you could check if setting LDFLAGS, CFLAGS, and CPPFLAGS is still needed.

I'm not sure if the way I'm doing this is quite right - it feels kludgy. One problem is I'm not sure the best way to distinguish when a pane is closed (we want to close the session) vs when we Quit atom (sessions should be detached but not closed).

@trusktr
Copy link
Author

trusktr commented Nov 9, 2018

Interesting. I haven't tried it yet, but my thought is that if you were to treat quitting Atom the same as closing a tab and close the session in both cases, that may be the easiest and most consistent way to implement it.

As for restoring the session, maybe in that case you could do something similar to macOS Terminal where it shows your previous output, then starts outputting the new sess output below that. So the previous content is there and useful for viewing/copying/referencing from the new (old) session.

Have you used macOS Terminal? Do you know what I mean?

@trusktr
Copy link
Author

trusktr commented Nov 9, 2018

If I close Atom I'd also like to think that any child processes were also closed.

In the case macOS is restarted (etc), the live sessions will be lost, so the restore-old-output idea would be useful there for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants