From 36e7c8d593228a9db77773e71cd81758fce5b671 Mon Sep 17 00:00:00 2001 From: Steven Pearson Date: Sat, 30 Mar 2024 14:16:13 +0100 Subject: [PATCH] fixes #716 Improve missing terminal error message. --- terms_dynamic.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terms_dynamic.go b/terms_dynamic.go index f552b0e..9e54944 100644 --- a/terms_dynamic.go +++ b/terms_dynamic.go @@ -27,9 +27,14 @@ import ( // will be automatically included anyway. "github.com/gdamore/tcell/v2/terminfo" "github.com/gdamore/tcell/v2/terminfo/dynamic" + + "fmt" ) func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { + if term == "" { + return nil, fmt.Errorf("%w: term not set", ErrTermNotFound) + } ti, _, e := dynamic.LoadTerminfo(term) if e != nil { return nil, e