X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=internal%2Faction%2Ftermpane.go;h=7fc0b8d1c2f386f3bc2699d13acd26855e6b1e4a;hb=90304fb472fab5a9809feb0d9b23b0930619cf0d;hp=540b23150f5cb26596d119a2c55a58a6e5bd40f7;hpb=9aaafe5dcf2c761b398e5caefc198dfb73521c27;p=micro.git diff --git a/internal/action/termpane.go b/internal/action/termpane.go index 540b2315..7fc0b8d1 100644 --- a/internal/action/termpane.go +++ b/internal/action/termpane.go @@ -1,6 +1,7 @@ package action import ( + "errors" "runtime" "github.com/zyedidia/clipboard" @@ -20,14 +21,18 @@ type TermPane struct { tab *Tab } -func NewTermPane(x, y, w, h int, t *shell.Terminal, id uint64, tab *Tab) *TermPane { +func NewTermPane(x, y, w, h int, t *shell.Terminal, id uint64, tab *Tab) (*TermPane, error) { + if !TermEmuSupported { + return nil, errors.New("Terminal emulator is not supported on this system") + } + th := new(TermPane) th.Terminal = t th.id = id th.mouseReleased = true th.Window = display.NewTermWindow(x, y, w, h, t) th.tab = tab - return th + return th, nil } func (t *TermPane) ID() uint64 {