fixes #716 Improve missing terminal error message.

This commit is contained in:
Steven Pearson 2024-03-30 14:16:13 +01:00 committed by Garrett D'Amore
parent fc16bf7007
commit 36e7c8d593
1 changed files with 5 additions and 0 deletions

View File

@ -27,9 +27,14 @@ import (
// will be automatically included anyway. // will be automatically included anyway.
"github.com/gdamore/tcell/v2/terminfo" "github.com/gdamore/tcell/v2/terminfo"
"github.com/gdamore/tcell/v2/terminfo/dynamic" "github.com/gdamore/tcell/v2/terminfo/dynamic"
"fmt"
) )
func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) {
if term == "" {
return nil, fmt.Errorf("%w: term not set", ErrTermNotFound)
}
ti, _, e := dynamic.LoadTerminfo(term) ti, _, e := dynamic.LoadTerminfo(term)
if e != nil { if e != nil {
return nil, e return nil, e