hearth
hearth copied to clipboard
terminal: notify when terminal has quit
Right now, if a process running in a terminal quits, the guest has no way of knowing about it. We have a few ways of fixing this:
- Polling: add a
TerminalUpdate
variant that polls the terminal for whether it's quit or not. Downside is that we have to continuously poll from whatever owns the terminal, which is ugly and inefficient. - Subscription: add a
TerminalUpdate
that subscribes a capability to a message that lets it know when that terminal has quit. Downsides are that it's clunky to implement in the API. We also need to find a way to use the state of aTerminalInstance
even though it's being ran as aSinkProcess
. - Killing: somehow wait for the terminal to quit in a separate Tokio thread, then kill the
TerminalInstance
. We can use down signals to notify processes when the terminal has exited. Downside is that the terminal immediately disappears once it's been killed.