On this page:
tui Tutorial:   Build a Terminal UI from Scratch
9.3

tui Tutorial: Build a Terminal UI from Scratch🔗ℹ

lu96-wow

This tutorial introduces the most common tui APIs in order: draw text, control the cursor and colors, handle input, and finally build a small application. Every interactive example exits with Esc. For the complete API, see the package manual index.scrbl; for more examples, see demo/.

Platform: tui supports Linux and Android/Termux only. On other platforms, use tui/char for a headless preview (see Next Steps).

    1 Setup

    2 First Step: Hello, TUI

    3 Coordinates and the Cursor

    4 Colors

    5 Draw a Frame

    6 Input

    7 Mouse, Paste, and Window Size

    8 Putting It Together

    9 Next Steps