mirror of https://github.com/gdamore/tcell.git
fixes #716 Improve missing terminal error message.
This commit is contained in:
parent
fc16bf7007
commit
36e7c8d593
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue