A developer details building a reusable viewport component in Go for navigating large text in terminal UIs (TUIs), then using it to create 'lore', a personal terminal pager. The post covers how terminal pagers work, the $PAGER environment variable, ANSI escape codes, Unicode handling complexities (graphemes, code point widths), and the architecture of the viewport component including search/filter, item selection, and wrapping. The viewport is built on the Bubble Tea framework and is also used in the author's Kubernetes log viewer 'kl'.

11m read timeFrom theleo.zone
Post cover image
Table of contents
Introduction to Terminal Paging #Terminal Applications/TUIs #The Viewport Component #My Terminal Pager: lore #

Sort: