Skip to content

Commit

Permalink
Fix testing of terminal on non-unix systems
Browse files Browse the repository at this point in the history
  • Loading branch information
s-macke committed Jun 20, 2024
1 parent dcd9635 commit 77d7e73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
term "github.com/nsf/termbox-go"
terminal "golang.org/x/term"
"log"
"os"
"strings"
"time"
)
Expand Down Expand Up @@ -41,7 +42,7 @@ type UI struct {

// InitTerminal initializes the terminal and sets the UI dimensions
func InitTerminal(minY time.Duration, maxY time.Duration) *UI {
if !terminal.IsTerminal(0) {
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
panic("Not a terminal")
}
ui := UI{
Expand Down

0 comments on commit 77d7e73

Please sign in to comment.