terminal

command
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 23 Imported by: ? 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

Command terminal opens the Tango terminal component (ui/terminal) in a window, connected to a shell on a local pseudo-terminal (sys/pty).

go run ./examples/terminal                          # $SHELL (or the platform default)
go run ./examples/terminal -shell "/bin/zsh -f"     # any program with arguments
go run ./examples/terminal -renderer cpu -font-size 15 -scheme dracula
go run ./examples/terminal -echo                    # no PTY: input is echoed back
go run ./examples/terminal -replay out.vt           # no PTY: plays recorded output
go run ./examples/terminal -remote                  # observes an in-memory daemon

Where there is no local pseudo-terminal (iOS, Android, js/wasm) the example falls back to the echo connection, so the same program shows the view, the soft keyboard and input methods on a phone. The echo and replay connections live in conns.go; they are small examples of implementing terminal.Conn.

On a phone the view is kept inside the safe area and above the soft keyboard.

The window title follows the title the program sets (OSC 0/2) and is "Tango Terminal" otherwise. The application quits when the program exits.

-auto presses 100 keys once the shell is up (x and Backspace in turn, so the line never wraps), one at a time, each as soon as the previous one has been echoed, and logs the key-to-echo latency (event posted until a frame shows the echo, including the PTY round trip) and the frame intervals; it needs a shell or -echo. Keys are posted right after a frame is built, so the latency is that of a key pressed just after a frame: the worst point of the display cycle. -bench-cat FILE runs "cat FILE" in the shell and logs the time until the output has been read and drawn (it waits for a line printed after cat); it needs a shell. -quit-after quits after the given duration (for scripted screenshots).

Jump to

Keyboard shortcuts

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