Documentation ¶
Index ¶
- Constants
- Variables
- func ExecCommand(name string, arg ...string) (string, error)
- func JobSend(j *Job, data string)
- func JobStop(j *Job)
- func RunBackgroundShell(input string) (func() string, error)
- func RunCommand(input string) (string, error)
- func RunInteractiveShell(input string, wait bool, getOutput bool) (string, error)
- type CallbackFile
- type CallbackFunc
- type Job
- type JobFunction
- type TermType
- type Terminal
Constants ¶
const ( TTClose = iota // Should be closed TTRunning // Currently running a command TTDone // Finished running a command )
Variables ¶
var CloseTerms chan bool
var Jobs chan JobFunction
Functions ¶
func ExecCommand ¶
ExecCommand executes a command using exec It returns any output/errors
func RunBackgroundShell ¶
RunBackgroundShell runs a shell command in the background It returns a function which will run the command and returns a string message result
func RunCommand ¶
RunCommand executes a shell command and returns the output/error
Types ¶
type CallbackFile ¶
A CallbackFile is the data structure that makes it possible to catch stderr and stdout write events
type CallbackFunc ¶
type CallbackFunc func(string)
type Job ¶ added in v2.0.7
type Job struct { *exec.Cmd Stdin io.WriteCloser }
Job stores the executing command for the job, and the stdin pipe
type JobFunction ¶
JobFunction is a representation of a job (this data structure is what is loaded into the jobs channel)
type Terminal ¶
type Terminal struct { State terminal.State Term *terminal.VT Status TermType Selection [2]buffer.Loc // contains filtered or unexported fields }
A Terminal holds information for the terminal emulator
func (*Terminal) Close ¶
func (t *Terminal) Close()
Close sets the Status to TTClose indicating that the terminal is done and should be closed
func (*Terminal) GetSelection ¶
GetSelection returns the selected text
func (*Terminal) HasSelection ¶
HasSelection returns whether this terminal has a valid selection
func (*Terminal) Start ¶
func (t *Terminal) Start(execCmd []string, getOutput bool, wait bool, callback func(out string, userargs []interface{}), userargs []interface{}) error
Start begins a new command in this terminal with a given view
func (*Terminal) Stop ¶
func (t *Terminal) Stop()
Stop stops execution of the terminal and sets the Status to TTDone
func (*Terminal) WriteString ¶
WriteString writes a given string to this terminal's pty