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).
()
| 258 | // Without this, quitting the TUI while the engine is alive orphans the |
| 259 | // subprocess (on Windows it also leaks the WinDivert kernel handle). |
| 260 | func (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. |