feat: move cursor.Hide()
to main
- hide cursor at the start of the client
- ensure cursor is shown again after client execution
🤖
This commit is contained in:
parent
064056e8cb
commit
deff8f3554
2 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"atomicgo.dev/cursor"
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
@ -19,6 +20,9 @@ var interrupt = make(chan os.Signal, 1)
|
||||||
func Start() {
|
func Start() {
|
||||||
signal.Notify(interrupt, os.Interrupt)
|
signal.Notify(interrupt, os.Interrupt)
|
||||||
|
|
||||||
|
cursor.Hide()
|
||||||
|
defer cursor.Show()
|
||||||
|
|
||||||
parameter_url := flag.String("url", "", "GoTomato Server URL (eg ws://localhost:8080/ws)")
|
parameter_url := flag.String("url", "", "GoTomato Server URL (eg ws://localhost:8080/ws)")
|
||||||
parameter_password := flag.String("password", "", "Control password for pomodoro session (optional)")
|
parameter_password := flag.String("password", "", "Control password for pomodoro session (optional)")
|
||||||
configfile := flag.String("config", "~/.config/ChronoTomato.yml", "path to config file (optional)")
|
configfile := flag.String("config", "~/.config/ChronoTomato.yml", "path to config file (optional)")
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package notifications
|
package notifications
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.smsvc.net/pomodoro/ChronoTomato/internal/shared"
|
|
||||||
"atomicgo.dev/cursor"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.smsvc.net/pomodoro/ChronoTomato/internal/shared"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
@ -13,7 +12,6 @@ func TerminalOutput() {
|
||||||
|
|
||||||
pomodoro := &shared.ServerMessage
|
pomodoro := &shared.ServerMessage
|
||||||
|
|
||||||
cursor.Hide()
|
|
||||||
fmt.Print("\033[H\033[2J") // Clears the screen
|
fmt.Print("\033[H\033[2J") // Clears the screen
|
||||||
|
|
||||||
color.Blue("Work: %d ◊ Break: %d ◊ Longbreak: %d\n\n",
|
color.Blue("Work: %d ◊ Break: %d ◊ Longbreak: %d\n\n",
|
||||||
|
|
Loading…
Reference in a new issue