mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-08-06 14:16:38 +08:00
Compare commits
3 Commits
e7539da356
...
73927658d7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
73927658d7 | ||
![]() |
bcdcf70348 | ||
![]() |
baa5973128 |
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@ -231,7 +231,7 @@ jobs:
|
||||
|
||||
- name: "Create source package"
|
||||
run: >
|
||||
git archive --format=tar.gz --prefix=ftxui/ -o source.tar.gz HEAD
|
||||
git archive --format=tar.gz -o source.tar.gz HEAD
|
||||
|
||||
- name: "Upload source package"
|
||||
uses: shogo82148/actions-upload-release-asset@v1
|
||||
|
7
.github/workflows/publish.yaml
vendored
7
.github/workflows/publish.yaml
vendored
@ -1,11 +1,4 @@
|
||||
on:
|
||||
# On new releases:
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag_name:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# On manual trigger:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
|
@ -4,7 +4,7 @@ Changelog
|
||||
Future release
|
||||
------------
|
||||
|
||||
6.1.0 (2025-04-29)
|
||||
6.1.1 (2025-04-30)
|
||||
-----------------
|
||||
|
||||
### Build
|
||||
@ -15,7 +15,7 @@ Future release
|
||||
|
||||
**MODULE.bazel**
|
||||
```bazel
|
||||
bazel_dep(name = "ftxui", version = "6.1.0")
|
||||
bazel_dep(name = "ftxui", version = "6.1.1")
|
||||
```
|
||||
|
||||
**BUILD.bazel**
|
||||
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(ftxui
|
||||
LANGUAGES CXX
|
||||
VERSION 6.1.0
|
||||
VERSION 6.1.1
|
||||
DESCRIPTION "C++ Functional Terminal User Interface."
|
||||
)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
# the LICENSE file.
|
||||
|
||||
# FTXUI Module.
|
||||
module(name = "ftxui", version = "6.1.0")
|
||||
module(name = "ftxui", version = "6.1.1")
|
||||
|
||||
# Build deps.
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
|
@ -372,7 +372,7 @@ include(FetchContent)
|
||||
|
||||
FetchContent_Declare(ftxui
|
||||
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
||||
GIT_TAG v6.1.0
|
||||
GIT_TAG v6.1.1
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(ftxui)
|
||||
|
@ -48,25 +48,38 @@ Dimensions& FallbackSize() {
|
||||
return g_fallback_size;
|
||||
}
|
||||
|
||||
const char* Safe(const char* c) {
|
||||
return (c != nullptr) ? c : "";
|
||||
}
|
||||
|
||||
bool Contains(const std::string& s, const char* key) {
|
||||
return s.find(key) != std::string::npos;
|
||||
}
|
||||
|
||||
// https://github.com/gabime/spdlog/blob/885b5473e291833b148eeac3b7ce227e582cd88b/include/spdlog/details/os-inl.h#L566
|
||||
std::string getenv_safe(const char *field) {
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(__cplusplus_winrt)
|
||||
return std::string{}; // not supported under uwp
|
||||
#else
|
||||
size_t len = 0;
|
||||
char buf[1024];
|
||||
bool ok = ::getenv_s(&len, buf, sizeof(buf), field) == 0;
|
||||
return ok ? buf : std::string{};
|
||||
#endif
|
||||
#else // revert to getenv
|
||||
char *buf = ::getenv(field); // NOLINT(*-mt-unsafe)
|
||||
return buf ? buf : std::string{};
|
||||
#endif
|
||||
}
|
||||
|
||||
Terminal::Color ComputeColorSupport() {
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
return Terminal::Color::TrueColor;
|
||||
#endif
|
||||
|
||||
std::string COLORTERM = Safe(std::getenv("COLORTERM")); // NOLINT
|
||||
std::string COLORTERM = getenv_safe("COLORTERM");
|
||||
if (Contains(COLORTERM, "24bit") || Contains(COLORTERM, "truecolor")) {
|
||||
return Terminal::Color::TrueColor;
|
||||
}
|
||||
|
||||
std::string TERM = Safe(std::getenv("TERM")); // NOLINT
|
||||
std::string TERM = getenv_safe("TERM");
|
||||
if (Contains(COLORTERM, "256") || Contains(TERM, "256")) {
|
||||
return Terminal::Color::Palette256;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user