Gracefully shut down the program when we are done

This commit is contained in:
HikariKnight 2023-04-09 18:16:59 +02:00
parent 7affa8d06d
commit be3bcb02f7
2 changed files with 19 additions and 5 deletions

View file

@ -14,8 +14,10 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "enter":
if m.loaded {
// Process the selected item
m.processSelection()
// Process the selected item, if the return value is true then exit the application
if m.processSelection() {
return m, tea.Quit
}
}
case "ctrl+z", "backspace":
// Go backwards in the model