Terminal UIs
Some of the latest updates to command-line programming with Go have included terminal UIs, or TUIs for short. Creating a TUI in Go opens a world of possibilities for building interactive command-line applications. There are a few fundamental concepts that are involved with building UIs for the terminal:
- Components: TUIs are composed of various components, such as buttons, input fields, and/or lists
- Layouts: Arranging components in a structured layout is crucial for a clean and intuitive design
- User input handling: Processing user input from keyboard events is fundamental to interactive interfaces
Some TUI packages provide support for event handling, such as mouse events and key presses, dynamic updates based on input data, or customizing the appearance of UI components. There are several popular TUI packages available. We will look at one in the following exercise, where we’ll build on a previous exercise in this chapter.