]> git.lizzy.rs Git - micro.git/blob - internal/action/terminal_supported.go
Update some docs
[micro.git] / internal / action / terminal_supported.go
1 // +build linux darwin dragonfly openbsd_amd64 freebsd
2
3 package action
4
5 import (
6         "github.com/zyedidia/micro/internal/shell"
7         "github.com/zyedidia/micro/pkg/shellwords"
8 )
9
10 const TermEmuSupported = true
11
12 func RunTermEmulator(h *BufPane, input string, wait bool, getOutput bool, callback string, userargs []interface{}) error {
13         args, err := shellwords.Split(input)
14         if err != nil {
15                 return err
16         }
17
18         t := new(shell.Terminal)
19         t.Start(args, getOutput, wait, callback, userargs)
20
21         id := h.ID()
22         h.AddTab()
23         id = MainTab().Panes[0].ID()
24
25         v := h.GetView()
26         MainTab().Panes[0] = NewTermPane(v.X, v.Y, v.Width, v.Height, t, id)
27         MainTab().SetActive(0)
28
29         return nil
30 }