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

Method stop

tui/run.go:254–269  ·  view source on GitHub ↗

stop sends SIGINT (Unix) or Kill (Windows) to the engine subprocess.

()

Source from the content-addressed store, hash-verified

252
253// stop sends SIGINT (Unix) or Kill (Windows) to the engine subprocess.
254func (m runModel) stop() tea.Cmd {
255 return func() tea.Msg {
256 m.st.mu.Lock()
257 defer m.st.mu.Unlock()
258 if m.st.cmd == nil || m.st.cmd.Process == nil {
259 return statusMsg("engine not running")
260 }
261 p := m.st.cmd.Process
262 if runtime.GOOS == "windows" {
263 _ = p.Kill()
264 } else {
265 _ = p.Signal(syscall.SIGINT)
266 }
267 return statusMsg("engine stopping")
268 }
269}
270
271type runLogMsg string
272type runExitMsg struct{ err error }

Callers 2

UpdateMethod · 0.95
shutdownMethod · 0.80

Calls 1

statusMsgTypeAlias · 0.85

Tested by

no test coverage detected