embeddedterm

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

The TUI runs on Bubble Tea v2 while portalis still speaks v1. This file is the seam between the two: v2 input messages are rewritten into the v1 shapes the emulator consumes, and the emulator's v1 commands are wrapped back into v2 commands.

Package embeddedterm hosts an interactive command in a PTY-backed terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environment

func Environment(reviewRange, base, head, headRev, prURL, sha, reviewedFile string) []string

Environment builds the context exposed to an embedded diff command. reviewedFile is the per-PR reviewed-marks JSON (path → fingerprint); an external reviewer that honors it shares live-pr's per-PR review progress instead of keeping its own global state.

Types

type StateMsg

type StateMsg struct{ SessionID string }

StateMsg asks the host to redraw after a terminal state change.

type Terminal

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

Terminal embeds one interactive process and its VT screen.

func New

func New(command, cwd string, env []string) *Terminal

New prepares command for execution in cwd. Environment values are appended to the inherited process environment by the PTY implementation.

func (*Terminal) Available

func (t *Terminal) Available() bool

Available reports whether the embedded reviewer can receive input.

func (*Terminal) Close

func (t *Terminal) Close()

Close terminates and reaps the child process.

func (*Terminal) Err

func (t *Terminal) Err() error

Err returns a startup/runtime error, if any.

func (*Terminal) Handles

func (t *Terminal) Handles(msg tea.Msg) bool

Handles reports whether msg belongs to the embedded PTY lifecycle.

func (*Terminal) Init

func (t *Terminal) Init() tea.Cmd

Init starts the child before returning its first output listener. Synchronous spawn prevents a late-starting reviewer from escaping shutdown ownership.

func (*Terminal) Resize

func (t *Terminal) Resize(width, height int)

Resize updates both the virtual screen and its PTY.

func (*Terminal) Update

func (t *Terminal) Update(msg tea.Msg) tea.Cmd

Update advances the PTY/emulator lifecycle or forwards focused input.

func (*Terminal) View

func (t *Terminal) View(width, height int) string

View returns exactly the current virtual terminal screen.

Jump to

Keyboard shortcuts

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