ssh

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package ssh runs an Oolong program on an accepted SSH terminal session.

It is a transport adapter, not an SSH server. Authentication, host keys, listening, connection limits and command routing remain with the application and charm.land/ssh. Run takes the session only after that policy has accepted it, and joins its byte stream and PTY window changes into the ordinary program host contract.

Core does not know this package exists. Programs and components therefore behave the same on a local terminal and over SSH, while applications that do not serve SSH do not acquire its dependency tree.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoPTY means the accepted SSH session did not request a terminal. Oolong
	// draws cells and therefore cannot run as a plain exec byte stream.
	ErrNoPTY = errors.New("ssh: session has no PTY")
	// ErrHostSet means the program configuration already names another transport.
	// Run never silently replaces one host with another.
	ErrHostSet = errors.New("ssh: program host is already set")
	// ErrWindowSize means an SSH window cannot safely describe a cell surface.
	ErrWindowSize = errors.New("ssh: invalid PTY window size")
)

Functions

func Run

func Run(session charmssh.Session, cfg program.Config) (err error)

Run runs cfg on session until the program stops, the client disconnects or the transport fails.

session must already have an accepted PTY. Run owns Oolong's input decoder, frame writer and terminal modes for the duration of the call, but it does not own the SSH channel itself and does not choose an exit status. The surrounding SSH handler retains those decisions and can report a non-nil result before returning.

The zero cfg.Color is resolved from the client's PTY environment rather than the server process environment. Terminal modes, character locale, wheel scaling and clipboard transport follow that same client-owned environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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