MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / tryQuit

Method tryQuit

internal/tui/app.go:869–880  ·  view source on GitHub ↗

tryQuit attempts to quit the app. If any loop is running, it shows the quit confirmation dialog instead of quitting immediately.

()

Source from the content-addressed store, hash-verified

867// tryQuit attempts to quit the app. If any loop is running, it shows the quit
868// confirmation dialog instead of quitting immediately.
869func (a App) tryQuit() (tea.Model, tea.Cmd) {
870 if a.manager != nil && a.manager.IsAnyRunning() {
871 a.previousViewMode = a.viewMode
872 a.viewMode = ViewQuitConfirm
873 a.quitConfirm.Reset()
874 a.quitConfirm.SetSize(a.width, a.height)
875 return a, nil
876 }
877 a.stopAllLoops()
878 a.stopWatcher()
879 return a, tea.Quit
880}
881
882// handleQuitConfirmKeys handles keyboard input for the quit confirmation dialog.
883func (a App) handleQuitConfirmKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {

Callers 4

UpdateMethod · 0.95
handleSettingsKeysMethod · 0.95
handleCompletionKeysMethod · 0.95
handlePickerKeysMethod · 0.95

Calls 5

stopAllLoopsMethod · 0.95
stopWatcherMethod · 0.95
IsAnyRunningMethod · 0.80
ResetMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected