Documentation
¶
Index ¶
- Variables
- func IsInstalled() bool
- type AttachSessionOptions
- type CaptureOptions
- type ChooseTreeOptions
- type Client
- type DetachClientOptions
- type NewWindowOptions
- type Option
- type Pane
- func (p *Pane) Capture(ctx context.Context) (string, error)
- func (p *Pane) CapturePane(ctx context.Context, op *CaptureOptions) (string, error)
- func (p *Pane) ChooseTree(ctx context.Context, op *ChooseTreeOptions) error
- func (p *Pane) DeleteOption(ctx context.Context, key string) error
- func (p *Pane) Kill(ctx context.Context) error
- func (p *Pane) Option(ctx context.Context, key string) (*Option, error)
- func (p *Pane) Options(ctx context.Context) ([]*Option, error)
- func (p *Pane) Select(ctx context.Context) error
- func (p *Pane) SelectPane(ctx context.Context, op *SelectPaneOptions) error
- func (p *Pane) SendKeys(ctx context.Context, line string) error
- func (p *Pane) SendLine(ctx context.Context, line string) error
- func (p *Pane) SetOption(ctx context.Context, key, option string) error
- func (p *Pane) Split(ctx context.Context) (*Pane, error)
- func (p *Pane) SplitWindow(ctx context.Context, op *SplitWindowOptions) (*Pane, error)
- type PanePosition
- type PaneSplitDirection
- type SelectPaneOptions
- type Server
- type Session
- func (s *Session) Attach(ctx context.Context) error
- func (s *Session) AttachSession(ctx context.Context, op *AttachSessionOptions) error
- func (s *Session) DeleteOption(ctx context.Context, key string) error
- func (s *Session) Detach(ctx context.Context) error
- func (s *Session) FirstPane(ctx context.Context) (*Pane, error)
- func (s *Session) GetWindowByIndex(ctx context.Context, idx int) (*Window, error)
- func (s *Session) GetWindowByName(ctx context.Context, name string) (*Window, error)
- func (s *Session) Kill(ctx context.Context) error
- func (s *Session) ListClients(ctx context.Context) ([]*Client, error)
- func (s *Session) ListPanes(ctx context.Context) ([]*Pane, error)
- func (s *Session) ListWindows(ctx context.Context) ([]*Window, error)
- func (s *Session) New(ctx context.Context) (*Window, error)
- func (s *Session) NewWindow(ctx context.Context, op *NewWindowOptions) (*Window, error)
- func (s *Session) NextWindow(ctx context.Context) error
- func (s *Session) Option(ctx context.Context, key string) (*Option, error)
- func (s *Session) Options(ctx context.Context) ([]*Option, error)
- func (s *Session) Pane(ctx context.Context, windowIdx, paneIdx int) (*Pane, error)
- func (s *Session) PreviousWindow(ctx context.Context) error
- func (s *Session) Rename(ctx context.Context, name string) error
- func (s *Session) SetOption(ctx context.Context, key, option string) error
- type SessionOptions
- type Socket
- type SplitWindowOptions
- type SwitchClientOptions
- type Tmux
- func (t *Tmux) Command(ctx context.Context, cmd ...string) (string, error)
- func (t *Tmux) DeleteOption(ctx context.Context, target, key, level string) error
- func (t *Tmux) DetachClient(ctx context.Context, op *DetachClientOptions) error
- func (t *Tmux) GetClient(ctx context.Context) (*Client, error)
- func (t *Tmux) GetClientByTty(ctx context.Context, tty string) (*Client, error)
- func (t *Tmux) GetPaneById(ctx context.Context, id string) (*Pane, error)
- func (t *Tmux) GetServerInformation(ctx context.Context) (*Server, error)
- func (t *Tmux) GetSessionByName(ctx context.Context, name string) (*Session, error)
- func (t *Tmux) GetWindowById(ctx context.Context, id string) (*Window, error)
- func (t *Tmux) HasSession(ctx context.Context, session string) bool
- func (t *Tmux) KillServer(ctx context.Context) error
- func (t *Tmux) ListAllPanes(ctx context.Context) ([]*Pane, error)
- func (t *Tmux) ListAllWindows(ctx context.Context) ([]*Window, error)
- func (t *Tmux) ListClients(ctx context.Context) ([]*Client, error)
- func (t *Tmux) ListSessions(ctx context.Context) ([]*Session, error)
- func (w *Tmux) New(ctx context.Context) (*Session, error)
- func (t *Tmux) NewSession(ctx context.Context, op *SessionOptions) (*Session, error)
- func (t *Tmux) Option(ctx context.Context, target, key, level string) (*Option, error)
- func (t *Tmux) Options(ctx context.Context, target, level string) ([]*Option, error)
- func (t *Tmux) Session(ctx context.Context, name string) (*Session, error)
- func (t *Tmux) SetOption(ctx context.Context, target, key, option, level string) error
- func (t *Tmux) SwitchClient(ctx context.Context, op *SwitchClientOptions) error
- type Window
- func (w *Window) DeleteOption(ctx context.Context, key string) error
- func (w *Window) FirstPane(ctx context.Context) (*Pane, error)
- func (w *Window) GetPaneByIndex(ctx context.Context, idx int) (*Pane, error)
- func (w *Window) Kill(ctx context.Context) error
- func (w *Window) ListActiveClients(ctx context.Context) ([]*Client, error)
- func (w *Window) ListActiveSessions(ctx context.Context) ([]*Session, error)
- func (w *Window) ListLinkedSessions(ctx context.Context) ([]*Session, error)
- func (w *Window) ListPanes(ctx context.Context) ([]*Pane, error)
- func (w *Window) Move(ctx context.Context, targetSession string, targetIdx int) error
- func (w *Window) Option(ctx context.Context, key string) (*Option, error)
- func (w *Window) Options(ctx context.Context) ([]*Option, error)
- func (w *Window) Rename(ctx context.Context, newName string) error
- func (w *Window) Select(ctx context.Context) error
- func (w *Window) SelectLayout(ctx context.Context, layout WindowLayout) error
- func (w *Window) SetOption(ctx context.Context, key, option string) error
- func (w *Window) Split(ctx context.Context) (*Pane, error)
- func (w *Window) SplitWindow(ctx context.Context, op *SplitWindowOptions) (*Pane, error)
- type WindowLayout
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when a requested entity (session, window, pane, client) does not exist.
Functions ¶
func IsInstalled ¶
func IsInstalled() bool
Returns true if tmux is installed on the system otherwise false.
Types ¶
type AttachSessionOptions ¶
type AttachSessionOptions struct {
WorkingDir string
DetachClients bool
// Stdout/Stderr will be redirected to these writers if set.
Output, Error io.Writer
}
Attach session options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#attach-session
type CaptureOptions ¶
type CaptureOptions struct {
EscTxtNBgAttr bool
EscNonPrintables bool
IgnoreTrailing bool
PreserveTrailing bool
PreserveAndJoin bool
}
Capture pane command options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#capture-pane
type ChooseTreeOptions ¶
Choose tree options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#choose-tree
type Client ¶
type Client struct {
// Activity is the time of client last activity as a Unix timestamp.
Activity string
// CellHeight is the height of each cell in pixels.
CellHeight int
// CellWidth is the width of each cell in pixels.
CellWidth int
// ControlMode is true if the client is in control mode.
ControlMode bool
// Created is the time the client was created as a Unix timestamp.
Created string
// Discarded contains bytes discarded when the client is not keeping up.
Discarded string
// Flags contains the client flags.
Flags string
// Height is the client terminal height in cells.
Height int
// KeyTable is the current key table of the client.
KeyTable string
// LastSession is the name of the client's last session.
LastSession string
// Name is the client name.
Name string
// Pid is the process ID of the client.
Pid int32
// Prefix is true if the prefix key has been pressed.
Prefix bool
// Readonly is true if the client is read-only.
Readonly bool
// Session is the name of the client's attached session.
Session string
// Termname is the terminal name of the client.
Termname string
// Termfeatures contains the terminal features of the client.
Termfeatures string
// Termtype is the terminal type of the client.
Termtype string
// Tty is the pseudo-terminal path of the client.
Tty string
// Uid is the user ID of the client.
Uid int32
// User is the username of the client.
User string
// Utf8 is true if the client supports UTF-8.
Utf8 bool
// Width is the client terminal width in cells.
Width int
// Written contains bytes written to the client.
Written string
// contains filtered or unexported fields
}
Client represents a tmux client (an attached terminal).
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Variable
type DetachClientOptions ¶
Options object for detaching a session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#detach-client
type NewWindowOptions ¶
New window options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#new-window
type Option ¶
type Option struct {
// Key is the option name.
Key string
// Value is the option value.
Value string
}
Option represents a tmux option which is a key-value pair.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#OPTIONS
type Pane ¶
type Pane struct {
// Active is true if this is the current pane in its window.
Active bool
// AtBottom is true if this pane is at the bottom of the window.
AtBottom bool
// AtLeft is true if this pane is at the left of the window.
AtLeft bool
// AtRight is true if this pane is at the right of the window.
AtRight bool
// AtTop is true if this pane is at the top of the window.
AtTop bool
// Bg is the pane background color.
Bg string
// Bottom is the bottom coordinate of the pane.
Bottom string
// CurrentCommand is the name of the currently running command in this pane.
CurrentCommand string
// CurrentPath is the current working directory of the pane.
CurrentPath string
// Dead is true if the pane is dead (process has exited).
Dead bool
// DeadSignal is the signal that killed the pane process.
DeadSignal int
// DeadStatus is the exit status of the dead pane process.
DeadStatus int
// DeadTime is the time the pane process died as a Unix timestamp.
DeadTime string
// Fg is the pane foreground color.
Fg string
// Format indicates if the format variables are being used.
Format bool
// Height is the pane height in cells.
Height int
// Id is the unique pane identifier (e.g., "%0").
Id string
// InMode is true if the pane is in a mode (e.g., copy mode).
InMode bool
// Index is the pane index in its window.
Index int
// InputOff is true if input to the pane is disabled.
InputOff bool
// Last is true if this was the last selected pane.
Last bool
// Left is the left coordinate of the pane.
Left string
// Marked is true if this pane is marked.
Marked bool
// MarkedSet is true if the marked pane is set in this session.
MarkedSet bool
// Mode is the name of the current pane mode, if any.
Mode string
// Path is the path of the pane (the initial working directory).
Path string
// Pid is the process ID of the command running in the pane.
Pid int32
// Pipe is true if the pane is piped to a command.
Pipe bool
// Right is the right coordinate of the pane.
Right string
// SearchString is the current search string in copy mode.
SearchString string
// SessionName is the name of the session containing this pane.
SessionName string
// StartCommand is the command the pane was started with.
StartCommand string
// StartPath is the path the pane was started with.
StartPath string
// Synchronized is true if the pane is synchronized with other panes.
Synchronized bool
// Tabs contains the tab positions in the pane.
Tabs string
// Title is the pane title.
Title string
// Top is the top coordinate of the pane.
Top string
// Tty is the pseudo-terminal path of the pane.
Tty string
// UnseenChanges is true if the pane has unseen changes.
UnseenChanges bool
// Width is the pane width in cells.
Width int
// WindowIndex is the index of the window containing this pane.
WindowIndex int
// contains filtered or unexported fields
}
Pane represents a tmux pane.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Variable
func (*Pane) Capture ¶
Captures the pane with background and text atrributes escaped. Shorthand for `CapturePane`.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#capture-pane
func (*Pane) CapturePane ¶
Captures the content of the pane
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#capture-pane
func (*Pane) ChooseTree ¶
func (p *Pane) ChooseTree(ctx context.Context, op *ChooseTreeOptions) error
Puts the pane in choose tree mode.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#choose-tree
func (*Pane) DeleteOption ¶
Deletes an option from this pane.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Pane) Kill ¶
Kills the pane.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#kill-pane
func (*Pane) Option ¶
Retrieves an option from this pane.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Pane) Options ¶
Retrieves all options in this pane.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Pane) Select ¶
Selects the pane with the provided options. Shorthand 'SelectPane' but with default options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-pane
func (*Pane) SelectPane ¶
func (p *Pane) SelectPane(ctx context.Context, op *SelectPaneOptions) error
Selects the pane with the provided options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-pane
func (*Pane) SendKeys ¶
Pane send-keys.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#send-keys
func (*Pane) SendLine ¶
SendLine sends keys to the pane and presses Enter. Shorthand for SendKeys(line) followed by SendKeys("Enter").
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#send-keys
func (*Pane) SetOption ¶
Sets an option with a given key. Note that custom options must begin with '@'.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Pane) Split ¶
Split the window (pane) and return the new pane. Shorthand for 'SplitWindow' but with default options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
func (*Pane) SplitWindow ¶
Split the window (pane) and return the new pane.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
type PanePosition ¶
type PanePosition string
Pane relative position.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-pane
const ( PanePositionUp PanePosition = "-U" PanePositionRight PanePosition = "-R" PanePositionDown PanePosition = "-D" PanePositionLeft PanePosition = "-L" )
Enumeration of pane positions.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-pane
type PaneSplitDirection ¶
type PaneSplitDirection string
Pane split direction.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
const ( PaneSplitDirectionHorizontal PaneSplitDirection = "-h" PaneSplitDirectionVertical PaneSplitDirection = "-v" )
Enumeration of pane split directions.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
type SelectPaneOptions ¶
type SelectPaneOptions struct {
TargetPosition PanePosition
}
Options for select pane.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-pane
type Server ¶
type Server struct {
// Pid is the process ID of the tmux server.
Pid int32
// Socket is the socket used to communicate with the server.
Socket *Socket
// StartTime is the time the server was started as a Unix timestamp.
StartTime string
// Uid is the user ID of the server process.
Uid string
// User is the username of the server process.
User string
// Version is the tmux version string.
Version string
// contains filtered or unexported fields
}
Server represents the tmux server.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Variable
type Session ¶
type Session struct {
// Activity is the time of session last activity as a Unix timestamp.
Activity string
// Alerts contains window alert flags for the session.
Alerts string
// Attached is the number of clients attached to this session.
Attached int
// AttachedList is a list of clients attached to this session.
AttachedList []string
// Created is the time the session was created as a Unix timestamp.
Created string
// Format indicates if the format variables are being used.
Format bool
// Group is the name of the session group, if any.
Group string
// GroupAttached is the number of clients attached to sessions in this group.
GroupAttached int
// GroupAttachedList is a list of clients attached to sessions in this group.
GroupAttachedList []string
// GroupList is a list of sessions in this group.
GroupList []string
// GroupManyAttached is true if multiple clients are attached to sessions in this group.
GroupManyAttached bool
// GroupSize is the number of sessions in this group.
GroupSize int
// Grouped is true if this session is part of a group.
Grouped bool
// Id is the unique session identifier (e.g., "$0").
Id string
// LastAttached is the time the session was last attached as a Unix timestamp.
LastAttached string
// ManyAttached is true if multiple clients are attached to this session.
ManyAttached bool
// Marked is true if this session contains the marked pane.
Marked bool
// Name is the session name.
Name string
// Path is the working directory for new panes in this session.
Path string
// Stack is the window stack order in this session.
Stack string
// Windows is the number of windows in this session.
Windows int
// contains filtered or unexported fields
}
Session represents a tmux session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Variable
func (*Session) Attach ¶
Attaches the current client to the session. Since this requires a client, it will attach to the terminal by redirecting. Shorthand for 'AttachSession', but with default configuration.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#attach-session
func (*Session) AttachSession ¶
func (s *Session) AttachSession(ctx context.Context, op *AttachSessionOptions) error
Attaches the current client to the session. Since this requires a client, it will attach to the terminal by redirecting. Provides the option to pipe output and error to a custom location.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#attach-session
func (*Session) DeleteOption ¶
Deletes an option from this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Session) Detach ¶
Detaches all clients attached to this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#detach-client
func (*Session) FirstPane ¶
FirstPane returns the first pane of the first window. Convenience method for the common case of accessing the default pane.
func (*Session) GetWindowByIndex ¶
GetWindowByIndex returns the window at the given index in this session. Returns ErrNotFound if no window at that index exists.
func (*Session) GetWindowByName ¶
GetWindowByName returns the window with the given name in this session. Returns ErrNotFound if no window with that name exists.
func (*Session) Kill ¶
Kills the session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#kill-session
func (*Session) ListClients ¶
List clients attached to this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-clients
func (*Session) ListPanes ¶
List panes for this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-panes
func (*Session) ListWindows ¶
Lists all windows for this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-windows
func (*Session) New ¶
Creates a new window in this session. Shorthand for 'NewWindow', but with default options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#new-window
func (*Session) NewWindow ¶
Creates a new window in this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#new-window
func (*Session) NextWindow ¶
Selects the next window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#next-window
func (*Session) Option ¶
Retrieves an option from this session.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Session) Options ¶
Retrieves all options in this session.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Session) Pane ¶
Pane returns a pane by window and pane index. Returns ErrNotFound if either the window or pane index is out of bounds.
func (*Session) PreviousWindow ¶
Selects the previous window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#previous-window
func (*Session) Rename ¶
Renames the session to a new name.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#rename-session
type SessionOptions ¶
type SessionOptions struct {
Name string
ShellCommand string
StartDirectory string
Width int
Height int
}
Options object for creating a session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#new-session
type Socket ¶
type Socket struct {
// Path is the filesystem path to the socket.
Path string
}
Socket represents a tmux socket used to communicate with the server.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#S
type SplitWindowOptions ¶
type SplitWindowOptions struct {
SplitDirection PaneSplitDirection
StartDirectory string
ShellCommand string
}
Split window options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
type SwitchClientOptions ¶
Switch Client command options
type Tmux ¶
type Tmux struct {
Socket *Socket
}
Entrypoint object to the library.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#DESCRIPTION
func (*Tmux) DeleteOption ¶
Deletes an option from this session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Tmux) DetachClient ¶
func (t *Tmux) DetachClient(ctx context.Context, op *DetachClientOptions) error
Detaches current client, a target client or all the clients of a target session.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#detach-client
func (*Tmux) GetClient ¶
GetClient returns the currently active client. Returns ErrNotFound if no client is active (e.g., when running outside tmux).
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#display-message
func (*Tmux) GetClientByTty ¶
GetClientByTty returns the client with the given tty. Returns ErrNotFound if no client with that tty exists.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#client_tty
func (*Tmux) GetPaneById ¶
GetPaneById returns the pane with the given Id. Returns ErrNotFound if no pane with that id exists.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#pane_id
func (*Tmux) GetServerInformation ¶
Get server information.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Variable
func (*Tmux) GetSessionByName ¶
GetSessionByName returns the session with the given name. Returns ErrNotFound if no session with that name exists.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#session_name
func (*Tmux) GetWindowById ¶
GetWindowById returns the window with the given Id. Returns ErrNotFound if no window with that id exists.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#window_id
func (*Tmux) HasSession ¶
Returns true if the session exists, false otherwise.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#has-session
func (*Tmux) KillServer ¶
Kills the server. Kills all clients and servers.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#kill-server
func (*Tmux) ListAllPanes ¶
Lists all panes in the server.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-panes
func (*Tmux) ListAllWindows ¶
Lists all windows.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-windows
func (*Tmux) ListClients ¶
List all clients.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-clients
func (*Tmux) ListSessions ¶
List sessions.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-sessions
func (*Tmux) New ¶
Creates a new session without attaching. Shorthand for 'NewSession', but with default options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#new-session
func (*Tmux) NewSession ¶
Creates a new session without attaching to it. Pass nil to create a session with default options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#new-session
func (*Tmux) Option ¶
Retrieves an option.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Tmux) Options ¶
Retrieves all options with provided params.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Tmux) Session ¶
Gets a session by name. Shorthand for `GetSessionByName`.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#session_name
func (*Tmux) SetOption ¶
Sets an option at the target with given key. level can be one of:
-p (pane), -w (window), -s (server) or empty (session)
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Tmux) SwitchClient ¶
func (t *Tmux) SwitchClient(ctx context.Context, op *SwitchClientOptions) error
Switches client to TargetSession for a TargetClient.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#switch-client
type Window ¶
type Window struct {
// Active is true if this is the current window in its session.
Active bool
// ActiveClients is the number of clients viewing this window.
ActiveClients int
// ActiveClientsList is a list of clients viewing this window.
ActiveClientsList []string
// ActiveSessions is the number of sessions on which this window is active.
ActiveSessions int
// ActiveSessionsList is a list of sessions on which this window is active.
ActiveSessionsList []string
// Activity is the time of window last activity as a Unix timestamp.
Activity string
// ActivityFlag is true if the window has activity alert.
ActivityFlag bool
// BellFlag is true if the window has bell alert.
BellFlag bool
// Bigger is true if the window is larger than the client.
Bigger bool
// CellHeight is the height of each cell in pixels.
CellHeight int
// CellWidth is the width of each cell in pixels.
CellWidth int
// EndFlag is true if this is the last window.
EndFlag bool
// Flags contains the window flags.
Flags string
// Format indicates if the format variables are being used.
Format bool
// Height is the window height in cells.
Height int
// Id is the unique window identifier (e.g., "@0").
Id string
// Index is the window index in the session.
Index int
// LastFlag is true if this was the last selected window.
LastFlag bool
// Layout is the window layout description.
Layout string
// Linked is true if the window is linked to multiple sessions.
Linked bool
// LinkedSessions is the number of sessions this window is linked to.
LinkedSessions int
// LinkedSessionsList is a list of sessions this window is linked to.
LinkedSessionsList []string
// MarkedFlag is true if this window contains the marked pane.
MarkedFlag bool
// Name is the window name.
Name string
// OffsetX is the horizontal offset into the visible window.
OffsetX int
// OffsetY is the vertical offset into the visible window.
OffsetY int
// Panes is the number of panes in this window.
Panes int
// RawFlags contains the raw window flags string.
RawFlags string
// SilenceFlag indicates if the window has silence alert (duration in seconds).
SilenceFlag int
// StackIndex is the window position in the window stack.
StackIndex int
// StartFlag is true if this is the first window.
StartFlag bool
// VisibleLayout is the visible window layout description.
VisibleLayout string
// Width is the window width in cells.
Width int
// ZoomedFlag is true if the window is zoomed.
ZoomedFlag bool
// contains filtered or unexported fields
}
Window represents a tmux window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Variable
func (*Window) DeleteOption ¶
Deletes an option from this window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Window) GetPaneByIndex ¶
GetPaneByIndex returns the pane at the given index in this window. Returns ErrNotFound if no pane at that index exists.
func (*Window) Kill ¶
Kills the window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#kill-window
func (*Window) ListActiveClients ¶
ListActiveClients returns the clients viewing this window. Clients that no longer exist are silently skipped.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#window_active_clients_list
func (*Window) ListActiveSessions ¶
ListActiveSessions returns the sessions on which this window is active. Sessions that no longer exist are silently skipped.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#window_active_sessions_list
func (*Window) ListLinkedSessions ¶
ListLinkedSessions returns the sessions linked to this window. Sessions that no longer exist are silently skipped.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#window_linked_sessions_list
func (*Window) ListPanes ¶
List panes for this window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#list-panes
func (*Window) Move ¶
Move this window to a different location. This will return an error if the window already exists.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#move-window
func (*Window) Option ¶
Retrieves an option from this window.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Window) Options ¶
Retrieves all options in this window.
https://man.openbsd.org/OpenBSD-current/man1/tmux.1#show-options
func (*Window) Rename ¶
Renames a window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#rename-window
func (*Window) Select ¶
Selects this window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-window
func (*Window) SelectLayout ¶
func (w *Window) SelectLayout(ctx context.Context, layout WindowLayout) error
Selects the layout for this window.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#select-layout
func (*Window) SetOption ¶
Sets an option with a given key. Note that custom options must begin with '@'.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#set-option
func (*Window) Split ¶
Splits the active pane of this window and returns the new pane. Shorthand for 'SplitWindow' but with default options.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
func (*Window) SplitWindow ¶
Splits the active pane of this window and returns the new pane.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#split-window
type WindowLayout ¶
type WindowLayout string
Window layout.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#WINDOWS_AND_PANES
const ( WindowLayoutEvenHorizontal WindowLayout = "even-horizontal" WindowLayoutEvenVertical WindowLayout = "even-vertical" WindowLayoutMainHorizontal WindowLayout = "main-horizontal" WindowLayoutMainVertical WindowLayout = "main-vertical" WindowLayoutTiled WindowLayout = "tiled" )
Enumeration of window layouts.
Reference: https://man.openbsd.org/OpenBSD-current/man1/tmux.1#WINDOWS_AND_PANES
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
create
command
|
|
|
get_server_info
command
|
|
|
list_clients
command
|
|
|
listing
command
|
|
|
sessions
command
|
|
|
windows_panes
command
|