A home terminal app's console setup and its fzt command palette (from at-home-tools, AHT-258)
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nelson 113cd575d0
All checks were successful
Suite release / module (push) Successful in 17s
Suite release / scope (push) Successful in 4s
Suite release / deploy-image (push) Has been skipped
Suite release / reserve (push) Has been skipped
Suite release / check-manifest (push) Has been skipped
Suite release / check-package (push) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (push) Has been skipped
Suite release / finalize (push) Has been skipped
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (push) Has been skipped
Suite release / reused-checks (push) Has been skipped
Suite release / publish (push) Has been skipped
Suite release / deliver (push) Has been skipped
Suite release / deliver-prune (push) Has been skipped
The command palette opens through tmux, drawn by the running fzt-automate (#3)
2026-12-01 04:54:37 -08:00
console_other.go termconsole moves in from at-home-tools, unchanged (#1) 2026-11-29 23:03:08 -08:00
console_windows.go termconsole moves in from at-home-tools, unchanged (#1) 2026-11-29 23:03:08 -08:00
console_windows_test.go termconsole moves in from at-home-tools, unchanged (#1) 2026-11-29 23:03:08 -08:00
go.mod termconsole moves in from at-home-tools, unchanged (#1) 2026-11-29 23:03:08 -08:00
go.sum termconsole moves in from at-home-tools, unchanged (#1) 2026-11-29 23:03:08 -08:00
options.go termconsole moves in from at-home-tools, unchanged (#1) 2026-11-29 23:03:08 -08:00
palette.go The command palette opens through tmux, drawn by the running fzt-automate (#3) 2026-12-01 04:54:37 -08:00
README.md The command palette opens through tmux, drawn by the running fzt-automate (#3) 2026-12-01 04:54:37 -08:00

termconsole

The console the house's terminal programs draw in: virtual terminal mode, its width, keys and the command palette.

  • VT(f): whether f is a console, turning on its escape sequences if so; Width(f) is its width in columns, 80 when it has none.
  • Open(): the console for reading keys, leaving the mouse with the terminal so a drag selects text and tmux turns the wheel into arrow keys. An "any key" prompt hears every key a person would press: a key with no name of its own is OtherKey.
  • Console.Palette(title, rows): the app's command palette, as a tmux popup over its pane drawn by the fzt-automate tmux keeps running (tmux display-picker, FZTA-25), so no program starts for it; returns the action picked, or "" when it was closed.
  • QuoteProgram(path): a program path quoted for a Windows command line.

Windows is the real implementation; elsewhere Open refuses and VT and Width answer plainly, so a program still builds there. It was at-home-tools' termconsole package until shared packages got repositories of their own (AGT-85, AHT-258).

Using it

require forgejo.romaine.life/romaine-life/termconsole v0.1.0
import "forgejo.romaine.life/romaine-life/termconsole"

if termconsole.VT(os.Stdout) {
    width := termconsole.Width(os.Stdout)
    ...
}

Testing

go test ./...; the console tests are Windows-only.

Shipping

A library: the release-module topic in pipeline-templates' fleet.json tags each merge that changes the code, and every fleet repository whose go.mod requires it gets a take-up. Forgejo pushes it to its public GitHub copy, which proxy.golang.org serves to builds outside CI.