pane

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 13 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 pane opens loupe review for the human in a new terminal pane beside the agent's, in Herdr, tmux, Orca, iTerm2 or Ghostty. It is the only package that runs any of them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeaderReserve

func HeaderReserve(getenv func(string) string) int

HeaderReserve is the columns at the right end of the terminal's first row that the pane host draws over, which a full-screen header leaves blank: Orca's pane controls, wherever its handle is set, and nothing elsewhere.

func Open

func Open(ctx context.Context, hosts []Host, req Request) (Host, Opened, error)

Open opens the pane in the first host that does not pass. A refusal stops the walk, since a later step may already have opened a pane. With every host passed it returns a nil Host and no error.

func TTYWidth

func TTYWidth() (int, bool)

TTYWidth reads the controlling terminal rather than stdout, which is a pipe under --json.

Types

type Ghostty

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

func (Ghostty) Name

func (Ghostty) Name() string

func (Ghostty) Open

func (g Ghostty) Open(ctx context.Context, req Request) (Opened, error)

Open passes when the focused terminal's working directory is neither loupe's nor one of its parents: the human is looking at some other terminal, and a split there would open review away from the agent.

type Herdr

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

func (Herdr) Name

func (Herdr) Name() string

func (Herdr) Open

func (h Herdr) Open(ctx context.Context, req Request) (Opened, error)

Open probes with pane layout, which opens nothing, so a sandboxed agent can rerun safely when only that step failed. The layout also reports the agent pane's width, which the agent's own tty often cannot.

type Host

type Host interface {
	Name() string
	// Open refuses at the first failed step and never retries: a retry could open a second pane.
	Open(ctx context.Context, req Request) (Opened, error)
}

Host is a terminal that can split beside the agent's pane and run review in the new one.

func Detect

func Detect(getenv func(string) string, goos string) []Host

Detect returns every host whose conditions are all met, in the order they are tried. The inner host of two nested ones comes first, because the agent sits in its pane: a Herdr session inside tmux or Orca, or tmux inside Orca, gives its panes both environments. tmux inside Herdr loses to Herdr, whose pane still opens where the human sees it. A host whose conditions are met only in part is left out.

type ITerm

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

func (ITerm) Name

func (ITerm) Name() string

func (ITerm) Open

func (it ITerm) Open(ctx context.Context, req Request) (Opened, error)

Open passes every value as a script argument, never spliced into AppleScript source, so a quote in a data root cannot change what the script does. Each split starts the profile's shell and the command is typed into it: a command given to the split replaces the shell, so the pane would close on a refusal before the human could read it.

type Opened

type Opened struct {
	PaneID    string
	Direction string
	// Focused is false when the host opened the pane without moving the human's view to it.
	Focused bool
}

type Orca

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

func (Orca) Name

func (Orca) Name() string

func (Orca) Open

func (o Orca) Open(ctx context.Context, req Request) (Opened, error)

Open never focuses the split. Orca's only focus call, switch, also moves the view to the pane's worktree, and no call reports which worktree the human is on, so it could pull them off another agent. Split has no --env, so LOUPE_HOME rides in the command.

type Request

type Request struct {
	Command  string
	TTYWidth func() (int, bool)
	Fix      string
}

Request carries LOUPE_HOME inside Command because a new pane's shell loads the user's profile rather than inheriting loupe's environment. TTYWidth is injected so tests never read a real terminal; nil is unreadable.

type Runner

type Runner func(ctx context.Context, path string, args ...string) (stdout, stderr []byte, err error)

type Tmux

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

func (Tmux) Name

func (Tmux) Name() string

func (Tmux) Open

func (t Tmux) Open(ctx context.Context, req Request) (Opened, error)

Open names the server detection read on every call, so a different default socket in loupe's environment cannot redirect it. The split never takes focus: a pane that did would catch the keys the human is typing for the agent.

Jump to

Keyboard shortcuts

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