tui

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package tui is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Package tui is the pure-stdlib + golang.org/x/term TUI client.

v0.1 implemented:

  • Raw-mode termios management (entry/exit, signal handling)
  • ANSI-based screen rendering (no termcap; VT100/xterm)
  • Scrollback view with full redraw (diff-based is roadmap)
  • Single-line input + history recall via Ctrl-P / Ctrl-N
  • Status line (profile, model, cost meter, web URL)
  • Inline permission prompt (allow once / session / tool / deny)
  • Slash-command tab completion + local dispatch (/clear, /help, /web, /quit; others forward to engine)
  • SGR mouse-wheel scroll + arrow/page/home/end keys
  • SIGWINCH resize handling
  • Two-press Ctrl-C exit (with mid-turn cancel)

Out of v0.1 (roadmap):

  • Diff-based redraw (full redraw is fine for typical scrollback)
  • Multiline input editor (Shift-Enter for newline)
  • Modal overlay with diff preview for permission prompts
  • Bracketed paste / kitty keyboard protocol
  • Syntax highlighting in tool output
  • Windows ConPTY (Unix-only; Windows ships the web client)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TUI

type TUI struct {
	Client   *inproc.Client
	ClientID ids.ClientID // matches Client.ID(); used to filter own TurnStarted echoes
	Session  ids.SessionID

	// Status line metadata, set by the caller before Run.
	Profile  string
	Model    string
	WebURL   string
	WebToken string
	// contains filtered or unexported fields
}

TUI is the bundled terminal client. It attaches to an engine via inproc and renders to os.Stdout in raw mode.

func New

func New(c *inproc.Client, session ids.SessionID) *TUI

New constructs a TUI bound to the given inproc Client.

func (*TUI) Run

func (t *TUI) Run(ctx context.Context) error

Run takes over the terminal, registers SIGWINCH/SIGINT/SIGTERM handlers, and pumps events + input until the user exits.

Jump to

Keyboard shortcuts

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