From d731fc3e524803838e6fd1cb145aa64fff7fe793 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Wed, 23 Oct 2024 13:58:17 +0200 Subject: [PATCH] feat: hide cursor --- go.mod | 1 + go.sum | 2 ++ internal/notifications/terminal.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/go.mod b/go.mod index f24a2c3..4192fff 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module ChronoTomato go 1.23.1 require ( + atomicgo.dev/cursor v0.2.0 atomicgo.dev/keyboard v0.2.9 git.smsvc.net/pomodoro/GoTomato v0.0.0-20241022065122-cb6616f400db github.com/charmbracelet/log v0.4.0 diff --git a/go.sum b/go.sum index 5c28837..fe9b589 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +atomicgo.dev/cursor v0.2.0 h1:H6XN5alUJ52FZZUkI7AlJbUc1aW38GWZalpYRPpoPOw= +atomicgo.dev/cursor v0.2.0/go.mod h1:Lr4ZJB3U7DfPPOkbH7/6TOtJ4vFGHlgj1nc+n900IpU= atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8= atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ= git.smsvc.net/pomodoro/GoTomato v0.0.0-20241022065122-cb6616f400db h1:KLq83XCEgM7f2BFRBX4IPlg73ASqlI85Ib5qLb0GDw0= diff --git a/internal/notifications/terminal.go b/internal/notifications/terminal.go index 8fcc9e1..c679555 100644 --- a/internal/notifications/terminal.go +++ b/internal/notifications/terminal.go @@ -2,6 +2,7 @@ package notifications import ( "ChronoTomato/internal/shared" + "atomicgo.dev/cursor" "fmt" "github.com/fatih/color" "strings" @@ -12,6 +13,7 @@ func TerminalOutput() { pomodoro := &shared.ServerMessage + cursor.Hide() fmt.Print("\033[H\033[2J") // Clears the screen color.Blue("Work: %d | Break: %d | Longbreak: %d\n\n",