summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-20 18:28:44 +0300
committerPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-20 18:28:44 +0300
commita9852f11afb3bd02d6b21a02c65b8b395cfdbe3e (patch)
treeddc56a05c787d858f054a5528001381e306bc338 /cmd
parent0bb906061e6e9cc034134181bb07be3ea33ed093 (diff)
Use alt screen and clear terminal before starting UI
Diffstat (limited to 'cmd')
-rw-r--r--cmd/tasksamurai/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/tasksamurai/main.go b/cmd/tasksamurai/main.go
index 65358e1..bd3cd24 100644
--- a/cmd/tasksamurai/main.go
+++ b/cmd/tasksamurai/main.go
@@ -27,7 +27,11 @@ func main() {
os.Exit(1)
}
- p := tea.NewProgram(&m)
+ // Clear the screen before starting the TUI to avoid leaving any
+ // previous command line artefacts behind.
+ fmt.Print("\033[H\033[2J")
+
+ p := tea.NewProgram(&m, tea.WithAltScreen())
if _, err := p.Run(); err != nil {
fmt.Fprintln(os.Stderr, "error running ui:", err)
os.Exit(1)