terminal

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package terminal provides terminal mode support for cdev. Terminal mode spawns Claude in the current terminal with PTY, allowing both local and remote (mobile) interaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

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

Runner manages terminal mode for Claude sessions. It connects Claude's PTY to the current terminal while also streaming output to WebSocket clients.

func NewRunner

func NewRunner(workDir, claudeCmd string, claudeArgs []string) *Runner

NewRunner creates a new terminal mode runner.

func (*Runner) IsRunning

func (r *Runner) IsRunning() bool

IsRunning returns whether a session is currently running.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, prompt string) error

Run starts Claude in terminal mode and blocks until completion. This connects Claude's PTY to the current terminal.

func (*Runner) SendInput

func (r *Runner) SendInput(data []byte) error

SendInput sends input to the PTY from a remote source (e.g., WebSocket).

func (*Runner) SetOutputWriter

func (r *Runner) SetOutputWriter(w io.Writer)

SetOutputWriter sets an additional writer for output (e.g., WebSocket). Output will be written to both stdout and this writer.

func (*Runner) Stop

func (r *Runner) Stop() error

Stop terminates the running Claude session.

Jump to

Keyboard shortcuts

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