tmux

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tmux provides tmux session management for side-by-side agent panes.

Index

Constants

View Source
const (
	PaneClaude = 0
	PaneCodex  = 1
	PaneStatus = 2
)

PaneIndex constants for the paired layout.

Variables

This section is empty.

Functions

func GenerateSessionName

func GenerateSessionName(repoName string, runID int) string

GenerateSessionName creates a session name for a run.

func IsTmuxAvailable

func IsTmuxAvailable() bool

IsTmuxAvailable checks if tmux is installed and available.

func ListSessions

func ListSessions() ([]string, error)

ListSessions returns a list of all tmux sessions.

Types

type Layout

type Layout struct {
	// contains filtered or unexported fields
}

Layout represents a tmux pane layout configuration.

func NewLayout

func NewLayout(session *Session) *Layout

NewLayout creates a new layout manager for a session.

func (*Layout) ClearPane

func (l *Layout) ClearPane(ctx context.Context, paneIndex int) error

ClearPane clears a pane's content.

func (*Layout) FocusPane

func (l *Layout) FocusPane(ctx context.Context, paneIndex int) error

FocusPane focuses on a specific pane.

func (*Layout) GetPaneContent

func (l *Layout) GetPaneContent(ctx context.Context, paneIndex int) (string, error)

GetPaneContent captures the content of a pane.

func (*Layout) PairedLayout

func (l *Layout) PairedLayout(ctx context.Context) error

PairedLayout creates the standard paired layout: +-------------+-------------+ | Claude | Codex | +-------------+-------------+

func (*Layout) ResizePanes

func (l *Layout) ResizePanes(ctx context.Context) error

ResizePanes resizes panes to equal size.

func (*Layout) SetPaneTitle

func (l *Layout) SetPaneTitle(ctx context.Context, paneIndex int, title string) error

SetPaneTitle sets the title of a pane.

func (*Layout) SyncPanes

func (l *Layout) SyncPanes(ctx context.Context, enable bool) error

SyncPanes enables synchronized input to all panes.

func (*Layout) TripleLayout

func (l *Layout) TripleLayout(ctx context.Context) error

TripleLayout creates a layout with a status pane: +-------------+-------------+ | Claude | Codex | +-------------+-------------+ | Status | +---------------------------+

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents a tmux session.

func NewSession

func NewSession(name, workDir string) *Session

NewSession creates a new tmux session manager.

func (*Session) Attach

func (s *Session) Attach(ctx context.Context) error

Attach attaches to the tmux session.

func (*Session) Create

func (s *Session) Create(ctx context.Context) error

Create creates the tmux session with side-by-side panes.

func (*Session) Exists

func (s *Session) Exists() bool

Exists checks if the tmux session already exists.

func (*Session) Kill

func (s *Session) Kill(ctx context.Context) error

Kill terminates the tmux session.

func (*Session) Name

func (s *Session) Name() string

Name returns the session name.

func (*Session) RenamePane

func (s *Session) RenamePane(ctx context.Context, paneIndex int, name string) error

RenamePane renames a pane (sets pane title).

func (*Session) RunInPane

func (s *Session) RunInPane(ctx context.Context, paneIndex int, command string) error

RunInPane runs a command in a specific pane.

func (*Session) SendKeys

func (s *Session) SendKeys(ctx context.Context, paneIndex int, keys string) error

SendKeys sends keys to a specific pane.

func (*Session) SetupLayout

func (s *Session) SetupLayout(ctx context.Context) error

SetupLayout creates the side-by-side layout for Claude and Codex.

func (*Session) WasCreated

func (s *Session) WasCreated() bool

WasCreated returns true if this instance created the session.

Jump to

Keyboard shortcuts

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