terminal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package terminal serves a shell over a WebSocket for the dashboard. Binary messages carry terminal bytes both ways; text messages from the browser are JSON resize requests: {"cols":80,"rows":24}.

Index

Constants

View Source
const Supported = true

Supported reports whether this platform has a terminal.

Variables

This section is empty.

Functions

func Serve

func Serve(w http.ResponseWriter, r *http.Request, opts Options)

Serve upgrades the request and runs a shell until either side closes. The WebSocket handshake refuses other origins than the page's own.

Types

type Options

type Options struct {
	Shell  string   // default $SHELL, then /bin/bash, then /bin/sh
	Dir    string   // default the home folder
	Env    []string // default os.Environ()
	Logger *slog.Logger
	// Who names the session in the log, for example the remote address.
	Who string
}

Options configure a terminal session.

Jump to

Keyboard shortcuts

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