# mmulet/term.everything — AlpLab Radar Static Code Audit

- Ring: `watch`
- Category: `dev`
- Overall score: `3.1/5`
- Implementation check: `partial`
- Maturity: `dormant`
- Audited commit: `c8e04be0ae9a` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-01T20:26:55Z
- Repository: https://github.com/mmulet/term.everything
- Radar entry: https://radar.alplab.co/#repo/mmulet/term.everything
- License: `AGPL-3.0`
- Tags: `wayland`, `compositor`, `terminal`, `chafa`, `linux`, `graphics`

## Summary

A from-scratch Wayland compositor written in Go (with a little cgo) that renders GUI client windows into a terminal as Unicode/ANSI art or kitty/iTerm2/sixel images via chafa, feeding keyboard and SGR mouse input back from stdin.

## Implementation Check

The core README claim is genuinely implemented (wayland/SocketListener.go MakeSocketListener hosts a real Wayland socket; framebuffertoansi/DrawState.go DrawDesktop renders the composited framebuffer via chafa), but help.md documents --xwayland/--xwayland-wm/--debug-log flags that are parsed in termeverything/ParseArgs.go and never referenced, with termeverything/MainLoop.go leaving 'TODO start xwaylnd_if_neccessary', so advertised X11-app support is not wired up.

## When to Use

Use it to run or demo Linux Wayland GUI apps inside a local terminal or over SSH where the bandwidh/terminal supports it; not for X11-only apps, non-Linux hosts, or mission-critical workflows — the README's own roadmap says only 'Term some things' and warns most apps may fail to launch or crash.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 3.5/5 |
| usability | 3.5/5 |
| reliability | 2.0/5 |
| security | 3.5/5 |
| integration | 3.0/5 |

## Code Evidence

main.go calls termeverything.MainLoop(), which creates a Unix socket listener (wayland/SocketListener.go MakeSocketListener/GetWaylandDisplayName) and spawns the user's app via exec.Command(shell, "-c", cmdStr) with WAYLAND_DISPLAY set (termeverything/MainLoop.go); the wire protocol is hand-implemented in wayland/Client.go (Client.ParseMessages/SendPendingMessage with a binary.LittleEndian 8-byte header and FD passing) over generated protocol code in wayland/protocols/ (wayland.xml.go, xdg-shell.xml.go) produced by the generator in wayland/generate/; buffers from wl_shm pools are bounds-check-copied into surface textures (wayland/CopyBufferToWlSurfaceTexture.go CopyBufferToWlSurfaceTexture, wayland/MemMap.go NewMemMapInfo, wayland/mmap.c mmap_fd) and composited by Z order into an RGBA framebuffer (wayland/Desktop.go Desktop.DrawClients), then converted to escape codes through chafa cgo (framebuffertoansi/ChafaInfo.go ChafaInfo.ConvertImage, framebuffertoansi/DetectTerminal.go DetectTerminal for kitty/iTerm2/sixel/symbols modes); input comes from raw-mode stdin (termeverything/RawMode.go EnableRawModeFD, termeverything/TerminalWindow.go InputLoop/ProcessCodes) with hand-rolled key and SGR mouse parsers (termeverything/ConvertKeycodeToXbdCode.go, termeverything/PointerCode.go ParseSGRMouseSequences), and the status bar is clickable (termeverything/StatusLine.go Status_Line.Line).

## Issues Found

1) --xwayland, --xwayland-wm and --debug-log are parsed in termeverything/ParseArgs.go but referenced nowhere else; termeverything/MainLoop.go still has 'TODO start xwaylnd_if_neccessary', so help.md's claim that --support-old-apps launches Xwayland is unimplemented — it only preserves XDG_SESSION_TYPE in the child env. 2) Version constant in termeverything/ParseArgs.go is "0.7.6" while the latest release is 0.7.8, so --version is stale. 3) wayland/SocketListener.go GetSocketPathFromName falls back to a predictable /tmp path and removeFileIfExists deletes whatever is there when XDG_RUNTIME_DIR is unset — symlink/race risk on shared hosts. 4) termeverything/TerminalWindow.go ProcessCodes and termeverything/TerminalDrawLoop.go DrawClients use `defer s.Access.Unlock()` inside a loop, holding every client lock until the function returns. 5) No tests or CI exist anywhere in the repo.

## Key Risks

Linux-only by design; building requires cgo plus chafa and glib-2.0 via pkg-config (framebuffertoansi/*.go) or the prebuilt release binary; zero test files (repo_search for 'func Test' returns nothing) and no CI, so nothing is verified statically beyond code reading; app compatibility is explicitly partial (README roadmap stage 1); robustness against malicious/buggy Wayland clients (protocol error paths, the 64KB Client.messageBuffer, FD accounting) could not be verified; key/mouse parsing is heuristic per-terminal and may drop or misparse sequences; repo is dormant (no commits in 90 days per maturity signals), and maturity caps the verdict at watch.

## Reviewed Files

- `Readme.md`
- `go.mod`
- `main.go`
- `ChangeLog.md`
- `Makefile`
- `distribute.sh`
- `resources/HowIDidIt.md`
- `termeverything/MainLoop.go`
- `termeverything/ParseArgs.go`
- `termeverything/TerminalDrawLoop.go`
- `termeverything/TerminalWindow.go`
- `termeverything/StatusLine.go`
- `termeverything/ConvertKeycodeToXbdCode.go`
- `termeverything/PointerCode.go`
- `termeverything/RawMode.go`
- `termeverything/profile.go`
- `termeverything/resources/help.md`
- `framebuffertoansi/ChafaInfo.go`
- `framebuffertoansi/DetectTerminal.go`
- `framebuffertoansi/DrawState.go`
- `wayland/ListenToWaylandSocket.go`
- `wayland/SocketListener.go`
- `wayland/Client.go`
- `wayland/Desktop.go`
- `wayland/CopyBufferToWlSurfaceTexture.go`
- `wayland/ApplyWlSurfaceDoubleBufferedState.go`
- `wayland/MemMap.go`
- `wayland/mmap.c`
- `wayland/wl_shm_pool.go`
