separete into fucntion and use charm dependency instead

This commit is contained in:
Robin Olsen
2026-03-24 21:04:05 +01:00
parent effc0a8f99
commit 9b06557455
4 changed files with 29 additions and 22 deletions

View File

@@ -6,9 +6,9 @@ import (
"log/slog"
"os"
"charm.land/bubbletea/v2"
tea "charm.land/bubbletea/v2"
"github.com/LazyBachelor/LazyPM/internal/models"
"golang.org/x/term"
"github.com/charmbracelet/x/term"
)
type App = models.App
@@ -125,8 +125,8 @@ func (r *TaskRunner) Run(ctx context.Context, t Tasker, i Interface, iType Inter
}
}
if oldState, err := term.GetState(int(os.Stdin.Fd())); err == nil {
term.Restore(int(os.Stdin.Fd()), oldState)
if oldState, err := term.GetState(uintptr(os.Stdin.Fd())); err == nil {
term.Restore(uintptr(os.Stdin.Fd()), oldState)
}
fmt.Print("\033[0m\033[?25h")