Overview
TUI (Terminal User Interface) mode is Glow’s interactive file browser that lets you discover, search, and read markdown files directly in your terminal. It provides a beautiful, keyboard-driven interface for navigating your documentation.Launching TUI Mode
TUI mode is activated when you run Glow without specifying a file to render:File Discovery
Glow’s TUI mode features intelligent file discovery:Git Repository Awareness
When scanning for markdown files, Glow uses thegitcha package to:
- Detect if you’re in a Git repository
- Automatically respect
.gitignorerules - Only show files that aren’t ignored by Git
node_modules, and other ignored files won’t clutter your markdown browser.
Showing Hidden Files
By default, Glow respects.gitignore and hides system files. To show all files including hidden and ignored ones:
The
--all flag switches between gitcha.FindFilesExcept() (respects .gitignore) and gitcha.FindAllFilesExcept() (shows everything) for file discovery.Navigation Controls
File List Navigation
Document Viewer Navigation
When viewing a markdown file in TUI mode:Searching and Filtering
Press/ to activate the filter:
- Start Filtering: Press
/to show the search input - Type Your Query: Glow uses fuzzy search to filter files as you type
- Navigate Results: Use
↑/↓orctrl+j/ctrl+kto browse matches - Select File: Press
enterto open the selected file - Clear Filter: Press
escto cancel or clear the filter
Mouse Support
Enable mouse support to scroll and interact with the TUI using your mouse:Line Numbers
Show line numbers when viewing markdown files:File Watching
When viewing a file in TUI mode, Glow automatically watches for changes usingfsnotify. If the file is modified externally, Glow will reload and re-render it automatically.
Example Workflow
Here’s a typical workflow using TUI mode:Integration with Git
Since Glow is Git-aware, it works seamlessly in repositories:Related
CLI Mode
Learn about rendering markdown directly to stdout
Configuration
Customize TUI behavior with configuration options