diff --git a/main.go b/main.go index 7496604..0d29ab0 100644 --- a/main.go +++ b/main.go @@ -294,7 +294,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.state = "Focus" m.startCommands(m.onFocusStart) - cmds = append(cmds, tick()) + cmds = append(cmds, tea.SetWindowTitle(fmt.Sprintf("Gomodoro - %s", m.state)), tick()) case timeMsg: // Handle timer update for each second @@ -326,6 +326,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Run onFocusStart commands m.startCommands(m.onFocusStart) } + + cmds = append(cmds, tea.SetWindowTitle(fmt.Sprintf("Gomodoro - %s", m.state))) } cmds = append(cmds, tick()) @@ -335,8 +337,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.height = msg.Height } - cmds = append(cmds, tea.SetWindowTitle(fmt.Sprintf("Gomodoro - %s", m.state))) - // Get errors from shellrunner for { result := m.shellrunner.GetResults()