capture

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package capture demonstrates streaming a subprocess's output into an on-screen pkg/logview with runner.Capture, next to a command picker, with tab cycling focus between the two.

Capture is the counterpart to runner.Run: Run hands the real terminal to a full-screen program and the TUI suspends, while Capture pipes stdout/stderr and the TUI stays live — so the user keeps scrolling, filtering and searching while the command runs (rule 15).

Under the app shell there is no plumbing to write. The shell chains the reads and forwards every message on, so a screen that wants the output in place just matches the three messages a capture emits: CaptureStarted, one CapturedLine per line, then one Captured. The same stream is feeding the app-wide console at the same time — press o and the run is all there, with its exit status, after this screen has scrolled it away.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the capture demo screen.

Types

type Screen

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

func (*Screen) Help

func (s *Screen) Help() []key.Binding

func (*Screen) HelpSections

func (s *Screen) HelpSections() []help.Section

HelpSections forwards to the Group — which names both panes and their groups — and adds this screen's own verbs, the kill key appearing only while something is running.

func (*Screen) Init

func (s *Screen) Init() tea.Cmd

func (*Screen) IsCapturingKeys

func (s *Screen) IsCapturingKeys() bool

func (*Screen) Layout

func (s *Screen) Layout() layout.Node

func (*Screen) OnEnter

func (s *Screen) OnEnter(any) tea.Cmd

func (*Screen) SetTheme

func (s *Screen) SetTheme(t theme.Theme)

func (*Screen) Title

func (s *Screen) Title() string

func (*Screen) Update

func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)

Jump to

Keyboard shortcuts

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