FTXUI
Copilot instructions11k starsChanged 21 days agoMITView on GitHub
FTXUI is a cross-platform C++ library for terminal-based user interfaces with a functional programming approach, inspired by React. ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the information here.
- Deletes or force-pushes
We split this copilot-instructions.md into the rules it gives an agent
19 rules. About 0 are common, 12 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 45
If Bazel is available:
- Distinctive: line 55
Run example applications to verify functionality:
- Distinctive: line 66
CRITICAL: Always run at least one DOM example and one Component example to verify both modules work
- Distinctive: line 69
Always run formatting before committing:
- Very specific: line 75
Required: Run formatting or the CI (.github/workflows/build.yaml) will fail
- Very specific: line 78
ALWAYS build with both -DFTXUI_BUILD_EXAMPLES=ON and -DFTXUI_BUILD_TESTS=ON when making changes
- Very specific: line 79
Run the complete test suite with ctest --output-on-failure
- Distinctive: line 80
All 302 tests must pass
- Distinctive: line 81
Scenario Testing: Run at least these validation scenarios:
- Distinctive: line 85
Run formatting tool to ensure code style compliance
- Very specific: line 161
Adding Examples: Add new .cpp files in examples/component/ or examples/dom/
- Very specific: line 165
When adding FTXUI to a project, use CMake FetchContent (recommended):
- Very specific: line 184
If CMake configuration fails, ensure C++20 support: cmake --version (need 3.12+)
- Very specific: line 185
If Ninja build fails, fall back to Make: cmake -S .
- Distinctive: line 186
If tests fail to build, GoogleTest download might have failed - check network connectivity
- Distinctive: line 191
If examples don't display correctly, terminal might not support colors/Unicode
- Distinctive: line 196
If format script fails, check that source files are not read-only
- Distinctive: line 202
ALWAYS run the formatting tool: before committing changes
- Distinctive: line 203
ALWAYS build and test examples: when making component/dom changes
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
FTXUI - Functional Terminal (X) User Interface
FTXUI is a cross-platform C++ library for terminal-based user interfaces with a functional programming approach, inspired by React.
ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the information here.
Working Effectively
Build System Setup and Commands
- Bootstrap and build the repository:
# Basic build (library only) - fast cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel $(nproc) # Build time: ~30 seconds. NEVER CANCEL. Set timeout to 120+ seconds. # Build with examples cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFTXUI_BUILD_EXAMPLES=ON cmake --build build --parallel $(nproc) # Build time: ~70 seconds. NEVER CANCEL. Set timeout to 180+ seconds. # Build with examples and tests cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFTXUI_BUILD_EXAMPLES=ON -DFTXUI_BUILD_TESTS=ON cmake --build build --parallel $(nproc) # Build time: ~113 seconds (includes GoogleTest download). NEVER CANCEL. Set timeout to 300+ seconds. - Alternative build with Ninja (faster):
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DFTXUI_BUILD_EXAMPLES=ON ninja -C build # Build time: ~62 seconds. NEVER CANCEL. Set timeout to 180+ seconds. - Run unit tests:
# Configure with tests enabled first, then: cd build && ctest --output-on-failure # Test time: ~4 seconds (302 tests). NEVER CANCEL. Set timeout to 60+ seconds.
Bazel Support
- FTXUI also supports Bazel build system
- WARNING: Bazel may fail due to network connectivity issues in sandboxed environments
- If Bazel is available:
bazel build //... # Build everything bazel test //... # Run tests
Validation
Manual Testing After Changes
- ALWAYS manually validate changes by building and running examples after making code modifications
- Run example applications to verify functionality:
# Build an example first cmake --build build --target ftxui_example_border # Run examples (they are interactive, use timeout to terminate) timeout 2s build/examples/dom/ftxui_example_border timeout 2s build/examples/dom/ftxui_example_color_gallery timeout 2s build/examples/component/ftxui_example_button - Examples should produce visual terminal output with borders, colors, and UI components
- CRITICAL: Always run at least one DOM example and one Component example to verify both modules work
Code Quality and Formatting
- Always run formatting before committing:
./tools/format.sh # Format time: ~7 seconds. NEVER CANCEL. Set timeout to 60+ seconds. - The format script adds license headers and runs clang-format on all source files
- Required: Run formatting or the CI (.github/workflows/build.yaml) will fail
Build Validation Requirements
- ALWAYS build with both
-DFTXUI_BUILD_EXAMPLES=ONand-DFTXUI_BUILD_TESTS=ONwhen making changes - Run the complete test suite with
ctest --output-on-failure - All 302 tests must pass
- Scenario Testing: Run at least these validation scenarios:
- Build library only (basic validation)
- Build with examples and run 2-3 different examples
- Build with tests and run complete test suite
- Run formatting tool to ensure code style compliance
Project Structure
Key Directories
/home/runner/work/FTXUI/FTXUI/
├── include/ftxui/ # Public header files
│ ├── component/ # Interactive component headers
│ ├── dom/ # DOM element headers
│ ├── screen/ # Screen and rendering headers
│ └── util/ # Utility headers
├── src/ftxui/ # Implementation files
│ ├── component/ # Interactive components (buttons, menus, etc.)
│ ├── dom/ # DOM elements (layout, styling, text)
│ ├── screen/ # Screen rendering and terminal handling
│ └── util/ # Utilities
├── examples/ # Example applications
│ ├── component/ # Interactive component examples
│ └── dom/ # DOM element examples
├── cmake/ # CMake configuration files
├── tools/ # Development tools (formatting, etc.)
└── .github/workflows/ # CI/CD configurationCore Library Modules
FTXUI is organized into three main modules that depend on each other:
┌component──┐ (Interactive UI components)
│┌dom──────┐│ (Layout and styling elements)
││┌screen─┐││ (Terminal rendering and input)
└┴┴───────┴┴┘- screen: Low-level terminal handling, colors, pixels, input
- dom: Layout elements (hbox, vbox, text, borders, etc.)
- component: Interactive components (buttons, menus, input fields)
CMake Build Options
| Option | Description | Default |
| FTXUI_BUILD_EXAMPLES | Build example applications | OFF |
| FTXUI_BUILD_DOCS | Build documentation | OFF |
| FTXUI_BUILD_TESTS | Build and enable tests | OFF |
| FTXUI_BUILD_MODULES | Build C++20 modules | OFF |
| FTXUI_ENABLE_INSTALL | Generate install targets | ON |
Common Tasks
Building Examples
# Build specific examples
cmake --build build --target ftxui_example_border
cmake --build build --target ftxui_example_button
cmake --build build --target ftxui_example_menu
# List all available examples
find build -name "ftxui_example_*" -type fRunning Tests
# Run all tests
cd build && ctest
# Run tests with verbose output
cd build && ctest --verbose
# Run specific test pattern
cd build && ctest -R "Button" --verboseWorking with Source Code
- Component Development: Modify files in
src/ftxui/component/for interactive elements - DOM Development: Modify files in
src/ftxui/dom/for layout and styling - Screen Development: Modify files in
src/ftxui/screen/for terminal rendering - Adding Examples: Add new
.cppfiles inexamples/component/orexamples/dom/ - Header Files: Public APIs are in
include/ftxui/[module]/
Integration Patterns
When adding FTXUI to a project, use CMake FetchContent (recommended):
include(FetchContent)
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v6.1.9
)
FetchContent_MakeAvailable(ftxui)
target_link_libraries(your_target PRIVATE
ftxui::component # For interactive components
ftxui::dom # For layout elements
ftxui::screen # For basic rendering
)Troubleshooting
Build Issues
- If CMake configuration fails, ensure C++20 support:
cmake --version(need 3.12+) - If Ninja build fails, fall back to Make:
cmake -S . -B build(without-G Ninja) - If tests fail to build, GoogleTest download might have failed - check network connectivity
- Build artifacts are in
build/directory - delete withrm -rf buildto clean
Example Issues
- Examples are interactive terminal applications - use
timeoutto terminate them - If examples don't display correctly, terminal might not support colors/Unicode
- Examples require terminal size of at least 80x24 for proper display
Formatting Issues
- Format script requires clang-format to be installed
- If format script fails, check that source files are not read-only
- Format script modifies files in-place - commit changes afterwards
Critical Reminders
- NEVER CANCEL long-running builds - they may take 2-3 minutes
- ALWAYS run the formatting tool before committing changes
- ALWAYS build and test examples when making component/dom changes
- SET APPROPRIATE TIMEOUTS: 300+ seconds for builds, 60+ seconds for tests
- BUILD TIMING EXPECTATIONS:
- Basic library: ~30 seconds
- With examples: ~70 seconds
- With examples + tests: ~113 seconds (first time, includes GoogleTest download)
- Subsequent builds: ~60-70 seconds
- Tests execution: ~4 seconds
- Formatting: ~7 seconds
Trending
Quiet since September.about the whole repository
Who's talking about ArthurSonzogni/FTXUI
- A Hacker News story“Ftxui: C++ Functional Terminal User Interface”Hacker News · Jun 5, 2021 · 147 points
- @seedante.bsky.social“I love graphics libraries because they always inspire some ideas github.com/ArthurSonzog... #gamedev”Bluesky · Dec 23, 2024 · 6 likes
- dtcxzyw/llvm-opt-benchmark“Wishlist for new benchmarks”GitHub · Jan 17, 2024 · 5 reactions
- A Hacker News story“Ftxui: C++ Functional Terminal User Interface”Hacker News · Aug 25, 2025 · 3 points
- A Hacker News story“Ftxui – C++ Functional Terminal User Interface”Hacker News · May 28, 2024 · 3 points
The biggest 5 of 59 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 59
Talked about on GitHub, Hacker News, Bluesky and the web (59 times).
On GitHub · 50
- Jan 17, 2024Wishlist for new benchmarks — dtcxzyw/llvm-opt-benchmarksays it tested it5 reactions · 15 comments
- Sep 12, 2023High level TUI framework wrapper (FTXUI, AppCUI) — nim-lang/needed-libraries3 reactions · 3 comments
- Jul 31, 2026Ftxui 7.0.2 — conan-io/conan-center-index2 reactions · 6 comments
- Jun 22, 2024部分的なTUI機能の実装(リアルタイムHexEditor) — DeNA/mempatch2 reactions · 3 comments
- Apr 28, 2024error: externally-managed-environment - Error: gcovr failed to install — aminya/setup-cpp2 reactions · 5 comments
45 more on GitHub
- Aug 12, 2020Use CMake FetchContent? — adrianoviana87/ltuiny2 reactions · 1 comment
- Aug 7, 2026[ftxui] update to 7.0.3 — microsoft/vcpkg1 reaction
- Jan 30, 2024[emscripten] Build hangs during linking on UCRT64 — msys2/MINGW-packages1 reaction · 25 comments
- Feb 5, 2022[ftxui] update to 2.0.0 — microsoft/vcpkg1 reaction · 1 comment
- Jan 24, 2022[Package]: FTXUI — termux/termux-packages1 reaction
- Jul 7, 2019Backspace ^H vs ^?. How to know — kmscon/kmscon1 reaction · 5 comments
- Sep 24, 2026Update dependency ArthurSonzogni/ftxui to v7 (ftxui) — mcmarius/oop-template0 reactions
- Sep 8, 2026Update FTXUI to 7.0.3 — oSoWoSo/oco-builder0 reactions
- Sep 6, 2026Update dependency ArthurSonzogni/ftxui to v7 (ftxui) - abandoned — mcmarius/oop-template0 reactions · 1 comment
- Aug 26, 2026Translate Conan Center ftxui recipe to LLAR — xgo-dev/llarhub0 reactions
- Aug 22, 2026ftxui: 6.1.9 → 7.0.3, json-tui: 1.4.1 → 1.4.2 — NixOS/nixpkgs0 reactions · 4 comments
- Aug 6, 2026ftxui 7.0.3 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 6, 2026ftxui@7.0.3 — bazelbuild/bazel-central-registry0 reactions · 1 comment
- Aug 5, 2026[ftxui] update to 7.0.2 — microsoft/vcpkg0 reactions
- Aug 1, 2026ftxui 7.0.2 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 1, 2026Publish ftxui@7.0.2 — bazelbuild/bazel-central-registry0 reactions · 1 comment
- Jul 14, 2026Bump ftxui from 6.1.9 to 7.0.1 — rameauv/gigabyte-aero-15-fusion-keyboard-linux-support0 reactions
- Jul 14, 2026ftxui 7.0.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Jul 14, 2026Publish ftxui@7.0.1 — bazelbuild/bazel-central-registry0 reactions · 1 comment
- Jul 7, 2026Bump ftxui from 6.1.9 to 7.0.0 — rameauv/gigabyte-aero-15-fusion-keyboard-linux-support0 reactions · 1 comment
- Jun 15, 2026[ftxui] update to 7.0.0 — microsoft/vcpkg0 reactions
- Jun 13, 2026ftxui 7.0.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jun 13, 2026Publish ftxui@7.0.0 — bazelbuild/bazel-central-registry0 reactions · 3 comments
- Jun 12, 2026Add a full-screen TUI layer (FTXUI) for interactive menus, tables, dashboards — and terminal games — andreasnonslid/CPP-Template0 reactions
- May 16, 2026Coding Agent CLI 界面技术栈与架构决策参考 — phantom5099/coding-code0 reactions
- Apr 20, 2026Add TUI interface with FTXUI for interactive and progress display — cantalupo555/torrent-builder0 reactions · 2 comments
- Apr 3, 2026Story 1: Add FTXUI dependency via CMake FetchContent — tofetpuzo/TradingApp0 reactions · 1 comment
- Mar 12, 2026Consider migrating to FTXUI v7 App API when released — deanturpin/stooge0 reactions
- Feb 1, 2026Add command pallete — suasuasuasuasua/task-tracker0 reactions
- Jan 5, 2026Add dom subpackage implementing Web DOM API for declarative TUI composition — charmbracelet/ultraviolet0 reactions · 12 comments
- Dec 4, 2025fix(bazel): ensure FTXUI is publicly accessible and add external smoke test — dskkato/FTXUI0 reactions
- Oct 29, 2025[device-management-application] Bump bundled FTXUI library and resolve breaking API change. — aifoundry-org/et-platform0 reactions · 1 comment
- Oct 14, 2025Add [ftxui] — msys2/MINGW-packages0 reactions · 1 comment
- Jul 2, 2025New library: FTXUI — mcmarius/oop-template0 reactions · 1 comment
- May 29, 2025ftxui: add version 6.1.9 — conan-io/conan-center-index0 reactions
- May 9, 2025[ftxui] update to 6.1.9 — microsoft/vcpkg0 reactions
- May 7, 2025Publish ftxui@6.1.9 — bazelbuild/bazel-central-registry0 reactions · 1 comment
- May 1, 2025[ftxui] update to 6.1.8 — microsoft/vcpkg0 reactions
- May 1, 2025Publish ftxui@6.1.8 — bazelbuild/bazel-central-registry0 reactions · 3 comments
- May 1, 2025Publish ftxui@6.1.7 — bazelbuild/bazel-central-registry0 reactions · 1 comment
- May 1, 2025ftxui: 6.0.2 -> 6.1.9 — NixOS/nixpkgs0 reactions · 1 comment
- Apr 6, 2025Replace `FetchContent` in `mil_preflight` CMakeLists with local external dep — uf-mil/mil20 reactions · 1 comment
- Apr 2, 2025ftxui: add version 6.0.2 — conan-io/conan-center-index0 reactions · 3 comments
- Mar 30, 2025[ftxui] Build error on arm64-osx — microsoft/vcpkg0 reactions
- Mar 25, 2025[ftxui] update to 6.0.0 — microsoft/vcpkg0 reactions · 1 comment
On Hacker News · 6
- Jun 5, 2021Ftxui: C++ Functional Terminal User Interface147 points · 70 comments
- Aug 25, 2025Ftxui: C++ Functional Terminal User Interface3 points
- May 28, 2024Ftxui – C++ Functional Terminal User Interface3 points
- Jan 28, 2019FTXUI, a functional terminal user interface in C++3 points
- Mar 30, 2024Functional Terminal User Interface2 points
1 more on Hacker News
- Jun 4, 2021C++ Functional Terminal User Interface1 point
On Bluesky · 2
- Dec 23, 2024I love graphics libraries because they always inspire some ideas github.com/ArthurSonzog... #gamedev — @seedante.bsky.social6 likes and reposts
- Dec 9, 2024Does this count? github.com/ArthurSonzog... — @gok99.bsky.social1 likes and repost
On the web · 1
- Jan 27, 2019FTXUI: Demo 2019 — google.com
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

