Documentation
¶
Index ¶
- func GenerateConfig(path string, scrollbackLines int) error
- func IsInsideTmux() bool
- type Client
- func (c *Client) Attach(name string) error
- func (c *Client) ChooseSession() error
- func (c *Client) CurrentSession() (string, error)
- func (c *Client) Detach() error
- func (c *Client) Go(name string) error
- func (c *Client) HasSession(name string) bool
- func (c *Client) KillServer() error
- func (c *Client) KillSession(name string) error
- func (c *Client) ListSessions() (string, error)
- func (c *Client) NewSession(name, workdir, shellCmd string) error
- func (c *Client) PaneCommand(name string) (string, error)
- func (c *Client) PaneCurrentPath(name string) (string, error)
- func (c *Client) PanePID(name string) (string, error)
- func (c *Client) RenameSession(oldName, newName string) error
- func (c *Client) RespawnPane(name, shellCmd string) error
- func (c *Client) SourceConfig() error
- func (c *Client) SwitchClient(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateConfig ¶
GenerateConfig writes a mobile-optimized tmux.conf to path.
func IsInsideTmux ¶
func IsInsideTmux() bool
IsInsideTmux returns true if the current process is running inside a tmux session.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps tmux CLI commands.
func (*Client) Attach ¶
Attach attaches to an existing tmux session, connecting stdin/stdout/stderr.
func (*Client) ChooseSession ¶
ChooseSession opens the tmux session chooser, connecting stdin/stdout/stderr.
func (*Client) CurrentSession ¶
CurrentSession returns the name of the current tmux session.
func (*Client) Go ¶
Go navigates to the named session, switching if inside tmux or attaching otherwise.
func (*Client) HasSession ¶
HasSession returns true if a tmux session with the given name exists.
func (*Client) KillServer ¶
KillServer kills the tmux server. Returns nil if there is no server running.
func (*Client) KillSession ¶
KillSession kills the named tmux session.
func (*Client) ListSessions ¶
ListSessions returns a newline-separated list of sessions, or empty string if none.
func (*Client) NewSession ¶
NewSession creates a new detached tmux session.
func (*Client) PaneCommand ¶
PaneCommand returns the start command of the first pane in the named session.
func (*Client) PaneCurrentPath ¶
PaneCurrentPath returns the current working directory of the pane in the named session.
func (*Client) RenameSession ¶
RenameSession renames a tmux session.
func (*Client) RespawnPane ¶
RespawnPane respawns the pane in the named session with the given shell command. The command is wrapped in /bin/sh -c so shell operators (||, &&) are interpreted. Unlike new-session, respawn-pane does not invoke $SHELL -c automatically.
func (*Client) SourceConfig ¶
SourceConfig loads the tmux config into the running server. This is needed because tmux -f only applies when starting a new server.
func (*Client) SwitchClient ¶
SwitchClient switches the tmux client to the named session.