diff --git a/ansi.go b/ansi.go index 24701c2..28e8ceb 100644 --- a/ansi.go +++ b/ansi.go @@ -48,7 +48,12 @@ func (p *dispatcher) Print(r rune) { } func (p *dispatcher) Execute(code byte) { - if code == 0x0A { + if code == '\t' { + for p.col%16 != 0 { + p.Print(' ') + } + } + if code == '\n' { p.endBackground() p.row++ p.col = 0 diff --git a/main.go b/main.go index b5b6c83..13c26ff 100644 --- a/main.go +++ b/main.go @@ -298,7 +298,7 @@ func main() { } if autoWidth { - longestLine := lipgloss.Width(strings.ReplaceAll(strippedInput, "\t", " ")) + longestLine := lipgloss.Width(strings.ReplaceAll(strippedInput, "\t", " ")) terminalWidth = float64(longestLine+1) * (config.Font.Size / fontHeightToWidthRatio) terminalWidth *= scale terminalWidth += hPadding