Expand description
The tray’s Quit asks first when it would stop agents that are working.
Quitting stops every agent. A window’s own close warns before it stops agents in the middle of
a turn; the tray’s Quit went straight to the host. It is also the Quit used with no window
open, when the agents running are the ones nobody is looking at. So the launcher asks srv who
is working (GET /agentmux/quit-question) and, when srv says to ask, puts the question in a
native dialog of its own: one that needs no window and that no page or agent can answer.
Quitting must always work. No answer from srv in time (srv is gone, hung or from a version without the question), or no way to show a dialog, quits as before. Only an explicit “keep running” stops the quit.
The restart into a new version is not asked here: it has its own question
(upgrade_restart), and goes to host_quit::quit_host directly.
Statics§
- SRV 🔒
- srv’s web endpoint (
host:port) and its key, from the last srv this launcher started.
Functions§
- confirm 🔒
- Linux:
zenity, or elsekdialog, as the upgrade question uses. With neither installed there is no dialog. - linux_
answer 🔒 - What
zenityorkdialogsaid, from its exit code and what it wrote to stderr. Both exit 0 for the first button (Quit) and 1 for the other one or a closed dialog (keep running). Anything else is a dialog that was never answered:None. So is an exit of 1 from a dialog that could not reach the display, which it says on stderr. - quit_
from_ tray - The tray’s “Quit AgentMux”. Asks on a thread of its own, so the tray’s other items keep working while the dialog is open; a second Quit while one is being asked about is dropped.
- srv_
is_ at - srv is up at
web_endpoint(srv_spawner::spawn_srv, on every start of it).