termstatus: move cursor handling to terminal package

This commit is contained in:
Michael Eischer
2025-09-07 13:49:26 +02:00
parent 0ab38faa2e
commit 93ccc548c8
7 changed files with 31 additions and 30 deletions

View File

@@ -8,6 +8,7 @@ import (
"strconv"
"testing"
"github.com/restic/restic/internal/terminal"
rtest "github.com/restic/restic/internal/test"
)
@@ -17,16 +18,16 @@ func TestSetStatus(t *testing.T) {
term.canUpdateStatus = true
term.fd = ^uintptr(0)
term.clearCurrentLine = posixClearCurrentLine
term.moveCursorUp = posixMoveCursorUp
term.clearCurrentLine = terminal.PosixClearCurrentLine
term.moveCursorUp = terminal.PosixMoveCursorUp
ctx, cancel := context.WithCancel(context.Background())
go term.Run(ctx)
const (
cl = posixControlClearLine
home = posixControlMoveCursorHome
up = posixControlMoveCursorUp
cl = terminal.PosixControlClearLine
home = terminal.PosixControlMoveCursorHome
up = terminal.PosixControlMoveCursorUp
)
term.SetStatus([]string{"first"})