]> git.lizzy.rs Git - micro.git/blob - internal/action/terminal_supported.go
Merge pull request #1437 from serebit/patch-2
[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         h.AddTab()
22         id := MainTab().Panes[0].ID()
23
24         v := h.GetView()
25         MainTab().Panes[0] = NewTermPane(v.X, v.Y, v.Width, v.Height, t, id)
26         MainTab().SetActive(0)
27
28         return nil
29 }