Documentation
¶
Index ¶
- Constants
- Variables
- func ParsePaneType(paneType string) string
- type Target
- type TmuxClient
- func (t TmuxClient) Attach(session string, stdin, stdout, stderr *os.File) error
- func (t TmuxClient) KillWindow(target Target) error
- func (t TmuxClient) ListPanes(target Target) ([]TmuxPane, error)
- func (t TmuxClient) ListSessions() ([]TmuxSession, error)
- func (t TmuxClient) ListWindows(target Target) ([]TmuxWindow, error)
- func (t TmuxClient) NewPane(target Target, dir, split string) (string, error)
- func (t TmuxClient) NewSession(name, dir, windowName string) (string, error)
- func (t TmuxClient) NewWindow(target Target, name, dir string) (string, error)
- func (t TmuxClient) RenumberWindows(session string) error
- func (t TmuxClient) SelectLayout(target Target, layout string) (string, error)
- func (t TmuxClient) SelectPane(target Target) error
- func (t TmuxClient) SelectWindow(target Target) error
- func (t TmuxClient) SendKeys(target Target, command string) error
- func (t TmuxClient) SessionExists(name string) bool
- func (t TmuxClient) SessionName() (string, error)
- func (t TmuxClient) SetEnv(session, key, value string) (string, error)
- func (t TmuxClient) StopSession(target Target) (string, error)
- func (t TmuxClient) SwitchClient(session string) error
- type TmuxPane
- type TmuxSession
- type TmuxWindow
Constants ¶
const ( LayoutTiled string = "tiled" LayoutMainHorizontal string = "main-horizontal" LayoutEvenHorizontal string = "even-horizontal" LayoutMainVertical string = "main-vertical" LayoutEvenVertical string = "even-vertical" )
const ColumnSep = "§"
Variables ¶
var ( ErrInvalidSplitType = errors.New("invalid split type") ErrInvalidFormat = errors.New("invalid shell output format") )
Functions ¶
func ParsePaneType ¶ added in v0.2.0
ParsePaneType returns the tmux pane split type.
Types ¶
type TmuxClient ¶
func (TmuxClient) Attach ¶
func (t TmuxClient) Attach( session string, stdin, stdout, stderr *os.File, ) error
Attach attaches to a session.
func (TmuxClient) KillWindow ¶
func (t TmuxClient) KillWindow(target Target) error
KillWindow kills a window in a session.
func (TmuxClient) ListPanes ¶
func (t TmuxClient) ListPanes(target Target) ([]TmuxPane, error)
ListPanes returns a list of panes in a window.
func (TmuxClient) ListSessions ¶
func (t TmuxClient) ListSessions() ([]TmuxSession, error)
ListSessions returns a list of sessions and their information.
func (TmuxClient) ListWindows ¶
func (t TmuxClient) ListWindows(target Target) ([]TmuxWindow, error)
ListWindows returns a list of windows and their information.
func (TmuxClient) NewPane ¶
func (t TmuxClient) NewPane(target Target, dir, split string) (string, error)
NewPane creates a new split in a session's window.
func (TmuxClient) NewSession ¶
func (t TmuxClient) NewSession(name, dir, windowName string) (string, error)
NewSession creates a new session with optional name and directory.
func (TmuxClient) NewWindow ¶
func (t TmuxClient) NewWindow(target Target, name, dir string) (string, error)
NewWindow creates a new window with optional name and directory.
func (TmuxClient) RenumberWindows ¶
func (t TmuxClient) RenumberWindows(session string) error
RenumberWindows renumbers windows' index in a session.
func (TmuxClient) SelectLayout ¶
func (t TmuxClient) SelectLayout(target Target, layout string) (string, error)
SelectLayout selects a layout for a window.
func (TmuxClient) SelectPane ¶
func (t TmuxClient) SelectPane(target Target) error
SelectPane selects a pane in a window.
func (TmuxClient) SelectWindow ¶
func (t TmuxClient) SelectWindow(target Target) error
SelectWindow selects a window in a session.
func (TmuxClient) SendKeys ¶ added in v0.1.2
func (t TmuxClient) SendKeys(target Target, command string) error
SendKeys sends key-strokes to a target.
func (TmuxClient) SessionExists ¶
func (t TmuxClient) SessionExists(name string) bool
SessionExists checks if a session exists.
func (TmuxClient) SessionName ¶
func (t TmuxClient) SessionName() (string, error)
SessionName returns the current session name.
func (TmuxClient) SetEnv ¶
func (t TmuxClient) SetEnv(session, key, value string) (string, error)
SetEnv sets an environment variable in a session.
func (TmuxClient) StopSession ¶
func (t TmuxClient) StopSession(target Target) (string, error)
StopSession stops a session.
func (TmuxClient) SwitchClient ¶
func (t TmuxClient) SwitchClient(session string) error
SwitchClient switches to a client.
type TmuxSession ¶
type TmuxSession struct { ID string `format:"session_id"` Name string `format:"session_name"` Path string `format:"session_path"` Attached bool `format:"session_attached"` Marked bool `format:"session_marked"` Windows int `format:"session_windows"` Stack string `format:"session_stack"` Alerts string `format:"session_alerts"` Created time.Time `format:"session_created"` Activity time.Time `format:"session_activity"` LastAttached time.Time `format:"session_last_attached"` }