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

Session 'Onhold' feature #6808

Closed
wsy opened this issue Jul 7, 2020 · 4 comments
Closed

Session 'Onhold' feature #6808

wsy opened this issue Jul 7, 2020 · 4 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@wsy
Copy link

wsy commented Jul 7, 2020

Description of the new feature/enhancement

I'm running some scripts with Windows Terminal (Windows App Store version).
I switched to some other app doing something else, and Windows Terminal got updated by Windows App Store.
After Windows Terminal opens again, every tab, every session, everything I was running was gone.
If Windows Terminal could have put those sessions in some sort of 'on-hold' state, and Windows Terminal would pick up those sessions again after it starts again, that would be great.

Proposed technical implementation details (optional)

I purpose that you may separate the concept 'session' from the concept 'window'/'Windows Terminal application'.
After decoupling these concepts, sessions run in standalone processes. When the application of Windows Terminal restarts, or maybe sometimes when it crashes, after we open Windows Terminal again, we may have our sessions back.
Those 'session' processes may have a timeout for maximum idle time. For example, if Windows Terminal quits with these sessions still running, after maybe 5 minutes, Windows Terminal did not connect to these sessions, then these sessions will quit themselves.

If you ever used iTerm on macOS, when sometimes it crashes, and I re-open iTerm within a very short time, everything can be restored. This is a good example of what I'm talking about.

@wsy wsy added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 7, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 7, 2020
@KalleOlaviNiemitalo
Copy link

Related issues:

I think this would then be a combination of:

  • Feature Request - Restore closed tab #960
  • The ability to find and reattach the sessions even after the main Windows Terminal process has crashed and been restarted.
  • Ensuring that updates from Windows Store leave the child processes running. Does Windows Store support leaving OpenConsole.exe of the previous version running across an upgrade?

In principle, condrv could allow detaching the console host process (conhost or openconsole) and later attaching a different one. That way, you could even upgrade OpenConsole.exe in an existing session. It would require:

  • condrv would have to freeze the console I/O until a console host is attached again.
  • condrv would have to support console IDs (perhaps LUID or GUID) so that the console host could attach to the correct console when restarting.
  • OpenConsole would have to save the console modes to a file and restore them when restarting.

However, such a change would increase the attack surface in the kernel, so it would be safer to leave OpenConsole.exe running.

@DHowett
Copy link
Member

DHowett commented Jul 8, 2020

@KalleOlaviNiemitalo Wow, this is absolutely comprehensive. Thank you.

We've also got #5000 tracking process model changes that might be required to pull something like this off. The main issue with keeping OpenConsole running is that it's also serviced as part of the store package so it wouldn't be particularly robust in the upgrade scenario.

This is really close to a request for a windows implementation of screen/tmux using ConPTY.

/dup #5000 #766 #960 ec.

@ghost
Copy link

ghost commented Jul 8, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Jul 8, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 8, 2020
@KalleOlaviNiemitalo
Copy link

I don't think those other issues cover the case where the main Windows Terminal process crashes and the user starts a new one and wants to attach the sessions to that. I haven't seen such crashes myself, though.

The main issue with keeping OpenConsole running is that it's also serviced as part of the store package so it wouldn't be particularly robust in the upgrade scenario.

The store platform installs each version of Windows Terminal to a different directory, doesn't it? So it would be able to leave the files of the previous version on disk as long as that version has processes running.

Or are you concerned that the new version of WindowsTerminal.exe would require features that the old version of OpenConsole.exe does not support?

Perhaps, a few years from now, Windows will include a conhost that has all the same features as OpenConsole, and Windows Terminal can just use that. Such a conhost might be easier to leave running across a Windows Terminal upgrade.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants