tmux

package
v0.0.0-...-af91a2b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(name string) error

Attach attaches the current tmux instance to the given session.

NOTE: We can't use the `scripts` package because (for some unknown reason to me) tmux` requires that we bind `stdout`, `stderr`, and `stdin` to the spawned process for it to work.

func DisplaySessions

func DisplaySessions() (string, error)

DisplaySessions dynamically renders all the current active sessions and allows you to traverse to them.

func GetCurrentSession

func GetCurrentSession() (string, error)

GetCurrentSession returns the name of the current tmux session.

func HasSession

func HasSession(name string) error

HasSession checks if the given session exists.

func KillSession

func KillSession(name string) error

KillSessions kills a session.

func KillWindow

func KillWindow(windowID string) error

KillWindow kills a window by its ID.

func ListSessions

func ListSessions() ([]string, error)

ListSessions returns a list of all the running Tmux sessions

func ListWindows

func ListWindows() ([]string, error)

ListWindows returns a list of window IDs in the current session.

func Ls

func Ls() ([]string, error)

Ls returns a list of `tmux` running sessions.

func NewSession

func NewSession(name string) error

NewSession creates a new tmux session.

func NewWindow

func NewWindow(name, command, directory string) error

NewWindow creates a new window with the given name, command, and directory.

func SelectWindow

func SelectWindow(name string) error

SelectWindow selects (focuses) a window by name.

func SessionExists

func SessionExists(name string) (bool, error)

SessionExists returns whether a session exists.

func Switch

func Switch(name string) error

Switch ensures that you create/switch/attach to a new session by name.

The value of `name` is supposed to be a directory path.

func SwitchClient

func SwitchClient(name string) error

SwitchClient switches the client to the given session.

func SwitchExisting

func SwitchExisting(name string) error

SwitchExisting switches to an existing session without creating it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL