pterm / pterm

✨ #PTerm is a modern Go module to easily beautify console output. Featuring charts, progressbars, tables, trees, text input, select menus and much more 🚀 It's completely configurable and 100% cross-platform compatible.

Home Page:https://pterm.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AreaPrinter does not replace content in Git Bash

radulucut opened this issue · comments

When using Git Bash on Windows, the content of the AreaPrinter is not replaced when calling Update, instead it is appended at the end.
Works fine when using the default terminal app.

Example:

package main

import (
	"fmt"
	"time"

	"github.com/pterm/pterm"
)

func main() {
	area, _ := pterm.DefaultArea.Start()
	tableData := pterm.TableData{
		{"Count", "Test"},
		{"", "test"},
	}

	for i := 0; i < 1000; i++ {
		tableData[1][0] = fmt.Sprintf("%d", i)
		t, _ := pterm.DefaultTable.WithHasHeader().WithData(tableData).Srender()
		area.Update(t)
		time.Sleep(100 * time.Millisecond)
	}
}
Screen Shot 2024-03-11 at 21 06 14

I encountered the same problem.