Talk given at Gophercon LATAM 2025, showing how to create and serve a TUI over SSH using Go libraries such as Bubble Tea, Lipgloss, Wish, and more.
I also explained a little bit about terminals, ansi sequences, and the SSH protocol.
and Unicode symbols ‣ Interactive applications ‣ Might mimic elements from modern UIs: text inputs, buttons ‣ Not easy to script ‣ Examples: vim/nvim, htop, btop, tig, lazygit, lazydocker, k9s 7 Carlos Becker - Gophercon Latam 2025
on VT102 ‣ Then it incorporated more features from other video terminals ‣ The Terminal application you use, whichever it might be, is a terminal emulator 12 Carlos Becker - Gophercon Latam 2025
Cursor movement, etc ‣ ECMA-48 is the international standardization of what began as ANSI ‣ ANSI was withdrawn in 1994 ‣ Everyone still calls them ANSI Sequences 14 Carlos Becker - Gophercon Latam 2025
\033, or \x1b) ‣ Several types of sequences: ESC, CSI, OSC, DCS, APC ‣ New sequences are still being created printf '\e[6n' printf '\e[33mHello Gophercon\e[0m' printf '\e[=31;1u' printf '\e]0;Hello Gophercon\a' printf '\eP+q636F6C73\e\' 15 Carlos Becker - Gophercon Latam 2025
know what SSH is ‣ SSH doesn't send the hostname as part of the initial handshake ‣ i18n and l10n: SSH doesn't send TZ and LC* by default (-o SendEnv) ‣ Handshake is a bit slow (-o ControlPersist) ‣ man ssh_config 21 Carlos Becker - Gophercon Latam 2025
default ‣ Authentication is a solved problem ‣ Can pipe from/into a host from your computer ‣ Can forward ports (which allow for some clever hacks) Friendly reminder: replace your RSA keys 22 Carlos Becker - Gophercon Latam 2025
Update, View ‣ Automatically downgrade colors based on user's terminal ‣ Many features built in: alt screens, mouse, resizing, background color detection, cursor, focus/blur, suspend/ resume, kitty keyboard, compositor (soon) ‣ Can be extended with Bubbles (components) and Huh (forms) 24 Carlos Becker - Gophercon Latam 2025
a text input as well: import ( "github.com/charmbracelet/bubbles/v2/spinner" "github.com/charmbracelet/bubbles/v2/textinput" ) type model struct { sw stopwatch.Model sp spinner.Model ti textinput.Model quitting bool suspending bool } 32 Carlos Becker - Gophercon Latam 2025
more about ANSI sequences (charm.sh/sequin) ‣ Use more components from charm.sh/bubbles and charm.sh/huh ‣ Dig through charm.sh/wish and charm.sh/bubbletea examples ‣ Deploy it somewhere (e.g.: fly.io) 53 Carlos Becker - Gophercon Latam 2025