Skip to content

Commit df71e54

Browse files
committed
Update only status bar and avoid flicker
1 parent 54650e5 commit df71e54

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

cmd/preview.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,21 @@ func watchAndMerge(previewWorktreePath, baseBranch string, branchEnabled map[str
726726
}
727727
}
728728

729+
// Update just the status bar (no screen clear - avoids flicker)
730+
updateStatusBar := func() {
731+
termWidth, termHeight, _ := getTerminalSize()
732+
branches := getEnabledBranches()
733+
734+
moveCursor(termHeight, 1)
735+
statusText := fmt.Sprintf(" Watching %d branches | Base: %s | %s ",
736+
len(branches), baseBranch, time.Now().Format("15:04:05"))
737+
fmt.Print(color.New(color.BgBlue, color.FgWhite).Sprint(statusText))
738+
padding := termWidth - len(statusText)
739+
if padding > 0 {
740+
fmt.Print(color.New(color.BgBlue).Sprint(strings.Repeat(" ", padding)))
741+
}
742+
}
743+
729744
// Draw modal menu overlay
730745
drawModal := func(title string, lines []string) {
731746
termWidth, termHeight, _ := getTerminalSize()
@@ -1188,8 +1203,8 @@ func watchAndMerge(previewWorktreePath, baseBranch string, branchEnabled map[str
11881203
}
11891204

11901205
if len(changedBranches) == 0 && len(changesDetectedBranches) == 0 {
1191-
// Just refresh status bar time
1192-
drawScreen()
1206+
// Just refresh status bar time (no flicker)
1207+
updateStatusBar()
11931208
continue
11941209
}
11951210

0 commit comments

Comments
 (0)