Skip to content

Commit e1d83a0

Browse files
committed
Fix TTY timer alignment leaving stale suffix
1 parent e8c2143 commit e1d83a0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

cmd/display/tty.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,18 @@ func (w *ttyWriter) printWithDimensions(terminalWidth, terminalHeight int) {
339339
}
340340
}
341341

342+
// pad timers so they all have the same visible width
343+
for i := range lines {
344+
l := &lines[i]
345+
if l.timer == "" {
346+
continue
347+
}
348+
timerWidth := utf8.RuneCountInString(l.timer)
349+
if timerWidth < timerLen {
350+
l.timer = l.timer + strings.Repeat(" ", timerLen-timerWidth)
351+
}
352+
}
353+
342354
// shorten details/taskID to fit terminal width
343355
w.adjustLineWidth(lines, timerLen, terminalWidth)
344356

0 commit comments

Comments
 (0)