attach

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 4 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 attach plans the TUI's full-screen attach to an agent's window (docs/TUI.md "Full-screen attach"): a nested tmux client of otag's server run with tea.ExecProcess, or, inside the user's own tmux, a full-screen display-popup that runs that client. The return keys (M-q, C-q, the "← otag" status button) detach it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	TMUX     string   // $TMUX: the user's own tmux server ("" = not inside tmux)
	TMUXPane string   // $TMUX_PANE: the TUI's pane in it
	Outer    string   // the user's tmux binary
	Version  string   // its `tmux -V` ("" unknown: no popup)
	Environ  []string // the TUI's environment
}

Env is where the TUI runs.

type Mode

type Mode int

Mode is how the TUI attaches.

const (
	Exec  Mode = iota // tmux attach in the TUI's terminal
	Popup             // a display-popup of the user's tmux
)

func (Mode) String

func (m Mode) String() string

type Plan

type Plan struct {
	Mode Mode
	Argv []string
	Env  []string
}

Plan is a command ready to run.

func Decide

func Decide(tc *tmux.Client, t Target, e Env) Plan

Decide picks the popup inside the user's tmux when it has display-popup -B (3.3), else a nested client in the TUI's own terminal.

func (Plan) Command

func (p Plan) Command() (*exec.Cmd, *Stderr)

Command is the plan as an *exec.Cmd for tea.ExecProcess (which gives it the terminal for stdin and stdout). Its stderr goes to stderr, whose text Err adds to a failure: tmux prints its errors there, and the TUI's redraw would hide them.

type Stderr

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

Stderr keeps the first 4 KiB written to it.

func (*Stderr) Err

func (s *Stderr) Err(err error) error

Err is err with the stderr text, if any.

func (*Stderr) Write

func (s *Stderr) Write(p []byte) (int, error)

type Target

type Target struct {
	Run, Session, Pane string
}

Target is the window to show: the run's tmux session and pane.

Jump to

Keyboard shortcuts

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