mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
💻 C++ Functional Terminal User Interface. ❤️
81b428af5a
I finally got access to a computer using the Microsoft's Windows OS. That's the opportunity to find and mitigate all the problems encountered. This patch: 1. Introduce an option and a C++ definition to enable fallback for Microsoft's terminal emulators. This allows me to see/test the Microsoft output from Linux. This also allows Windows users to remove the fallback and target non Microsoft terminals on Windows if needed. 2. Microsoft's terminal suffer from a race condition bug when reporting the cursor position: https://github.com/microsoft/terminal/pull/7583. The mitigation is not to ask for the cursor position in fullscreen mode where it isn't really needed and request it less often. This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/136 3. Microsoft's terminal do not handle properly hidding the cursor. Instead the character under the cursor is hidden, which is a big problem. As a result, we don't enable setting the cursor to the best position for [input method editors](https://en.wikipedia.org/wiki/Input_method), It will be displayed at the bottom right corner. See: - https://github.com/microsoft/terminal/issues/1203 - https://github.com/microsoft/terminal/issues/3093 4. Microsoft's terminals do not provide a way to query if they support colors. As a fallback, assume true colors is supported. See issue: - https://github.com/microsoft/terminal/issues/1040 This mitigates: - https://github.com/ArthurSonzogni/FTXUI/issues/135 5. The "cmd" on Windows do not properly report its dimension. Powershell works correctly. As a fallback, use a 80x80 size instead of 0x0. 6. There are several dom elements and component displayed incorrectly, because the font used is missing several unicode glyph. Use alternatives or less detailled one as a fallback. |
||
---|---|---|
.github | ||
.nxxm | ||
cmake | ||
doc | ||
examples | ||
include/ftxui | ||
src/ftxui | ||
tools | ||
.clang-format | ||
CMakeLists.txt | ||
ftxui-config.cmake.in | ||
iwyu.imp | ||
LICENSE | ||
README.md |
FTXUI
Functional Terminal (X) User interface
A simple C++ library for terminal based user interface.
Demo:
Feature
- Functional style. Inspired by [1] and React
- Simple and elegant syntax (in my opinion).
- Support for UTF8 and fullwidth chars (→ 测试).
- No dependencies.
- Cross platform. Linux/mac (main target), Windows (experimental thanks to contributors), WebAssembly.
- Keyboard & mouse navigation.
Operating systems
Example:
vbox({
hbox({
text(L"left") | border,
text(L"middle") | border | flex,
text(L"right") | border,
}),
gauge(0.5) | border,
});
┌────┐┌───────────────────────────────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└───────────────────────────────────────────────────────────────┘└─────┘
┌────────────────────────────────────────────────────────────────────────────┐
│██████████████████████████████████████ │
└────────────────────────────────────────────────────────────────────────────┘
Documentation:
Project using FTXUI
Feel free to add your projects here:
- git-tui
- rgb-tui
- chrome-log-beautifier
- x86-64 CPU Architecture Simulation
- ltuiny
- i3-termdialogs
- Just-Fast
- simpPRU
- Pigeon ROS TUI
- hastur
- CryptoCalculator
- todoman
Hosted on:
External package:
It is highly recommanded to use cmake FetchContent to depends on FTXUI. This way you can specify which commit you would like to depends on.
If you don't, the following packages have been created:
- vcpkg (soon)
- Arch Linux PKGBUILD.