MCPcopy Create free account
hub / github.com/SamNet-dev/snix / shutdown

Method shutdown

tui/app.go:260–266  ·  view source on GitHub ↗

shutdown kills the engine subprocess if one is running, then quits the Bubble Tea program. Idempotent — safe to call when no engine is running. Without this, quitting the TUI while the engine is alive orphans the subprocess (on Windows it also leaks the WinDivert kernel handle).

()

Source from the content-addressed store, hash-verified

258// Without this, quitting the TUI while the engine is alive orphans the
259// subprocess (on Windows it also leaks the WinDivert kernel handle).
260func (a App) shutdown() tea.Cmd {
261 if a.run.isRunning() {
262 // Run stop() synchronously, then quit.
263 return tea.Sequence(a.run.stop(), tea.Quit)
264 }
265 return tea.Quit
266}
267
268// configReloadMsg is sent after external config changes (e.g. after saving
269// scan results) so the tabs refresh.

Callers 1

UpdateMethod · 0.95

Calls 2

isRunningMethod · 0.80
stopMethod · 0.80

Tested by

no test coverage detected