Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRelayEscape = errors.New("relay: ctrl+o escape")
ErrRelayEscape is returned by PTYRelay.Run() when the user presses Ctrl+O to escape back to the TUI prefix mode.
var ErrRelayLayout = errors.New("relay: ctrl+l layout")
ErrRelayLayout is returned by PTYRelay.Run() when the user presses Ctrl+L to escape back to the TUI layout mode (e.g. to minimize/un-maximize the pane with `m`). Without this, an interactive program maximized via the relay could only be exited via Ctrl+O, leaving no way to minimize it.
var ErrRelayModeSwitch = errors.New("relay: esc esc mode switch")
ErrRelayModeSwitch is returned by PTYRelay.Run() when the user presses Esc twice — the universal "switch modes" chord — so the TUI can cycle the pane's input mode (shell → prompt → rysh → chat) without leaving the interactive session for good. Cycling back to shell re-enters the relay, the app having kept running in the PTY. Mirrors the in-pane double-Esc gesture for raw panes.
Functions ¶
func OSC52Output ¶
OSC52Output returns the writer OSC 52 sequences should be sent to, plus a cleanup func. It prefers the controlling terminal (/dev/tty) over os.Stdout: a direct stdout write can interleave with a partially-flushed bubbletea frame (corrupting the escape sequence mid-bytes), and goes nowhere useful when stdout is redirected. Falls back to os.Stdout when there is no controlling tty (e.g. Windows).
func OSC52Sequences ¶
OSC52Sequences returns the escape sequence(s) that copy s to the clipboard of the terminal that owns the display, adapted to the terminal chain described by env (os.Getenv in production):
- Plain terminal: one raw OSC 52 sequence.
- GNU screen (TERM=screen*): OSC 52 wrapped in DCS chunks — screen forwards DCS payloads to the outer terminal unchanged but eats raw OSC 52.
- tmux ($TMUX set, or TERM=tmux*): BOTH a raw sequence and a tmux-passthrough-wrapped one. Raw works when tmux's set-clipboard is "on" or "external" (the default); the wrapped copy works when set-clipboard is off but allow-passthrough is on. Whichever tmux config is in effect drops the sequence it doesn't understand; if both get through, the terminal just sets the same clipboard content twice.
$TMUX wins over a screen-looking TERM because tmux sets TERM=screen* by default.
Types ¶
type DetachMsg ¶
type DetachMsg struct{}
DetachMsg is sent to the Bubble Tea program by the signal handler when an external "rysh detach <name>" command targets this session. It triggers the same graceful detach path as the in-app ctrl+p d / ctrl+o d keystrokes.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea model for the Rysh TUI. It communicates with the WorkspaceActor purely via NATS messages. It does NOT import internal/actors.
func NewModel ¶
NewModel creates the TUI model. The WorkspaceActor must already be running (spawned via bus.ActorSystem()) before this is called.
type PTYRelay ¶
type PTYRelay struct {
// contains filtered or unexported fields
}
PTYRelay implements tea.ExecCommand. When Bubble Tea calls Run(), the relay takes over stdin/stdout and proxies data between the real terminal and the PTY via NATS — the daemon's rawReadLoop publishes raw PTY bytes to a dedicated NATS subject, and the relay writes them directly to stdout. Input from stdin is published back to the PaneActor via NATS.
func NewPTYRelay ¶
NewPTYRelay creates a new NATS-based relay for the given pane.
func (*PTYRelay) Run ¶
Run implements the blocking relay loop. It puts the real terminal in raw mode, enters alt screen, subscribes to NATS relay output, activates relay mode on the daemon, and proxies data until the interactive program exits or the user presses Ctrl+O.
Source Files
¶
- completion.go
- completion_bash.go
- content_stream.go
- cwd_linux.go
- email_view.go
- keys.go
- mcp_status.go
- model.go
- model_attention.go
- model_geometry.go
- model_input.go
- model_mouse.go
- model_native.go
- model_raw.go
- model_readline.go
- model_scroll.go
- model_shellprompt.go
- model_spend.go
- model_update.go
- model_view.go
- model_voice.go
- osc52.go
- relay.go
- replay_pane.go