diff --git a/examples/bubbletea/main.go b/examples/bubbletea/main.go index 3a54db5..e14b0a0 100644 --- a/examples/bubbletea/main.go +++ b/examples/bubbletea/main.go @@ -62,7 +62,7 @@ func main() { func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) { pty, _, active := s.Pty() if !active { - fmt.Println("no active terminal, skipping") + wish.Fatalln(s, "no active terminal, skipping") return nil, nil } m := model{ diff --git a/examples/bubbleteaprogram/main.go b/examples/bubbleteaprogram/main.go index 4beb282..9fcc372 100644 --- a/examples/bubbleteaprogram/main.go +++ b/examples/bubbleteaprogram/main.go @@ -72,8 +72,7 @@ func myCustomBubbleteaMiddleware() wish.Middleware { teaHandler := func(s ssh.Session) *tea.Program { pty, _, active := s.Pty() if !active { - fmt.Println("no active terminal, skipping") - _ = s.Exit(1) + wish.Fatalln(s, "no active terminal, skipping") return nil } m := model{ diff --git a/examples/simple/main.go b/examples/simple/main.go index fa0032b..2faa474 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -26,7 +26,7 @@ func main() { wish.WithMiddleware( func(h ssh.Handler) ssh.Handler { return func(s ssh.Session) { - fmt.Fprintln(s, "Hello, world!") + wish.Println(s, "Hello, world!") h(s) } },