Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ftxui for openSUSE:Factory checked 
in at 2026-07-15 16:37:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ftxui (Old)
 and      /work/SRC/openSUSE:Factory/.ftxui.new.1991 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ftxui"

Wed Jul 15 16:37:26 2026 rev:6 rq:1365656 version:7.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ftxui/ftxui.changes      2026-06-15 
19:49:21.394293416 +0200
+++ /work/SRC/openSUSE:Factory/.ftxui.new.1991/ftxui.changes    2026-07-15 
16:57:59.431789299 +0200
@@ -1,0 +2,25 @@
+Tue Jul 14 12:21:48 UTC 2026 - Michael Vetter <[email protected]>
+
+- Update to 7.0.1:
+  Screen:
+  * Bugfix: Restore TrueColor support on Windows Terminal (default to TrueColor
+    on Windows and check WT_SESSION environment variable for WSL
+    compatibility). See #1305.
+  * Feature: Honor the NO_COLOR environment variable (https://no-color.org).
+    When set and non-empty, colors degrade to the terminal's default colors.
+  * Bugfix: Apple's Terminal.app (TERM_PROGRAM=Apple_Terminal) is now reported
+    as Palette256 instead of TrueColor; it does not support 24bit colors.
+  * Bugfix: An empty terminal name or terminal emulator name is now treated as
+    unidentified by Terminal::ComputeColorSupport, instead of implying
+    TrueColor support.
+  * Bugfix: Avoid segmentation fault / crash during static initialization if
+    Color::RGB or other color constants are constructed globally/statically
+    before main(). See #1303.
+  Build:
+  * Bugfix: Fix build failure when an older FTXUI is installed in a system
+    include path (e.g. MacPorts upgrade). A CMake deduplication quirk was
+    promoting the project's own -I include/ to -isystem, causing package
+    managers' -I/opt/local/include (which may contain stale headers) to win.
+    See #1299, #1300.
+
+-------------------------------------------------------------------

Old:
----
  v7.0.0.tar.gz

New:
----
  v7.0.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ftxui.spec ++++++
--- /var/tmp/diff_new_pack.UUTsnf/_old  2026-07-15 16:58:00.607829000 +0200
+++ /var/tmp/diff_new_pack.UUTsnf/_new  2026-07-15 16:58:00.607829000 +0200
@@ -18,7 +18,7 @@
 
 %define         c_lib libftxui7
 Name:           ftxui
-Version:        7.0.0
+Version:        7.0.1
 Release:        0
 Summary:        A C++ library for terminal based user interfaces
 License:        MIT

++++++ v7.0.0.tar.gz -> v7.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/.github/workflows/release.yaml 
new/FTXUI-7.0.1/.github/workflows/release.yaml
--- old/FTXUI-7.0.0/.github/workflows/release.yaml      2026-06-13 
23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/.github/workflows/release.yaml      2026-07-14 
13:59:09.000000000 +0200
@@ -59,7 +59,8 @@
       - name: "Install cmake"
         uses: lukka/get-cmake@latest
 
-      - name: "Build packages"
+      - name: "Build packages (Linux / macOS)"
+        if: runner.os != 'Windows'
         run: >
           mkdir build;
           cd build;
@@ -74,6 +75,24 @@
           -DFTXUI_DEV_WARNINGS=ON ;
           cmake --build . --target package;
 
+      - name: "Build packages (Windows — Debug + Release)"
+        if: runner.os == 'Windows'
+        shell: pwsh
+        run: |
+          mkdir build
+          cd build
+          cmake .. `
+            -DCMAKE_BUILD_PARALLEL_LEVEL=${{ steps.cpu-cores.outputs.count }} `
+            -DFTXUI_BUILD_DOCS=OFF `
+            -DFTXUI_BUILD_EXAMPLES=OFF `
+            -DFTXUI_BUILD_TESTS=OFF `
+            -DFTXUI_BUILD_TESTS_FUZZER=OFF `
+            -DFTXUI_ENABLE_INSTALL=ON `
+            -DFTXUI_DEV_WARNINGS=OFF
+          cmake --build . --config Debug
+          cmake --build . --config Release
+          cpack -C "Debug;Release"
+
       - uses: shogo82148/actions-upload-release-asset@v1
         with:
           upload_url: ${{ needs.release.outputs.upload_url }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/.gitignore new/FTXUI-7.0.1/.gitignore
--- old/FTXUI-7.0.0/.gitignore  2026-06-13 23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/.gitignore  2026-07-14 13:59:09.000000000 +0200
@@ -88,8 +88,11 @@
 !tools/**/*.sh
 !tools/**/*.py
 !tools/**/*.cpp
+!tools/**/*.ps1
 !tools/abi_fingerprint.txt
 !tools/abidiff_suppressions.ini
+# Windows VM disk images and ssh keys, created by tools/windows-vm.sh:
+tools/windows-vm/data/
 build/
 build_asan/
 builddir/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/CHANGELOG.md new/FTXUI-7.0.1/CHANGELOG.md
--- old/FTXUI-7.0.0/CHANGELOG.md        2026-06-13 23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/CHANGELOG.md        2026-07-14 13:59:09.000000000 +0200
@@ -4,6 +4,26 @@
 Next
 ====
 
+7.0.1 (2026-07-14)
+------------------
+
+### Screen
+- Bugfix: Restore TrueColor support on Windows Terminal (default to TrueColor 
on Windows and check `WT_SESSION` environment variable for WSL compatibility). 
See #1305.
+- Feature: Honor the `NO_COLOR` environment variable (https://no-color.org). 
When set and non-empty, colors degrade to the terminal's default colors.
+- Bugfix: Apple's Terminal.app (`TERM_PROGRAM=Apple_Terminal`) is now reported 
as `Palette256` instead of `TrueColor`; it does not support 24bit colors.
+- Bugfix: An empty terminal name or terminal emulator name is now treated as 
unidentified by `Terminal::ComputeColorSupport`, instead of implying TrueColor 
support.
+- Bugfix (Windows): Downgrade color support when the console rejects VT 
processing (legacy consoles), instead of emitting TrueColor escape sequences.
+- Bugfix: Avoid segmentation fault / crash during static initialization if 
`Color::RGB` or other color constants are constructed globally/statically 
before `main()`. See #1303.
+
+
+### Build
+- Bugfix: Fix build failure when an older FTXUI is installed in a system
+  include path (e.g. MacPorts upgrade). A CMake deduplication quirk was
+  promoting the project's own `-I include/` to `-isystem`, causing package
+  managers' `-I/opt/local/include` (which may contain stale headers) to
+  win. See #1299, #1300.
+
+
 7.0.0 (2026-06-13)
 ------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/CMakeLists.txt 
new/FTXUI-7.0.1/CMakeLists.txt
--- old/FTXUI-7.0.0/CMakeLists.txt      2026-06-13 23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/CMakeLists.txt      2026-07-14 13:59:09.000000000 +0200
@@ -30,7 +30,7 @@
 endif()
 project(ftxui
   LANGUAGES CXX
-  VERSION 7.0.0
+  VERSION 7.0.1
   DESCRIPTION "C++ Functional Terminal User Interface."
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/MODULE.bazel new/FTXUI-7.0.1/MODULE.bazel
--- old/FTXUI-7.0.0/MODULE.bazel        2026-06-13 23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/MODULE.bazel        2026-07-14 13:59:09.000000000 +0200
@@ -1,7 +1,7 @@
 # FTXUI module.
 module(
     name = "ftxui",
-    version = "7.0.0",
+    version = "7.0.1",
 )
 
 # Build dependencies.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/README.md new/FTXUI-7.0.1/README.md
--- old/FTXUI-7.0.0/README.md   2026-06-13 23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/README.md   2026-07-14 13:59:09.000000000 +0200
@@ -367,6 +367,7 @@
 - [Fallout terminal 
hacking](https://github.com/gshigin/yet-another-fallout-terminal-hacking-game)
 - [Lazylist](https://github.com/zhuyongqi9/lazylist)
 - [Memory game](https://github.com/mikolajlubiak/memory)
+- [nfolens](https://github.com/a4x7/nfolens)
 - [Path Finder](https://github.com/Ruebled/Path_Finder)
 - [Pigeon ROS TUI](https://github.com/PigeonSensei/Pigeon_ros_tui)
 - [SHOOT!](https://github.com/ShingZhanho/ENGG1340-Project-25Spring)
@@ -402,7 +403,7 @@
 - [tiles](https://github.com/tusharpm/tiles)
 - [todoman](https://github.com/aaleino/todoman)
 - [turing_cmd](https://github.com/DanArmor/turing_cmd)
-- [typing-speed-test](https://github.com/ymcx/typing-speed-test)
+- [typing-speed-test](https://codeberg.org/ymcx/typing-speed-test)
 - [vantage](https://github.com/gokulmaxi/vantage)
 - [x86-64 CPU Architecture Simulation](https://github.com/AnisBdz/CPU)
 - [C++ Process Manager](https://github.com/ondrejhonus/cpp_proc)
@@ -430,7 +431,7 @@
 include(FetchContent)
 FetchContent_Declare(ftxui
   GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
-  GIT_TAG v7.0.0
+  GIT_TAG v7.0.1
 )
 FetchContent_MakeAvailable(ftxui)
 
@@ -451,7 +452,7 @@
 ```starlark
 bazel_dep(
     name = "ftxui",
-    version = "7.0.0",
+    version = "7.0.1",
 )
 ```
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/bazel/test/MODULE.bazel 
new/FTXUI-7.0.1/bazel/test/MODULE.bazel
--- old/FTXUI-7.0.0/bazel/test/MODULE.bazel     2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/bazel/test/MODULE.bazel     2026-07-14 13:59:09.000000000 
+0200
@@ -6,7 +6,7 @@
     version = "0.0.1",
 )
 
-bazel_dep(name = "ftxui", version = "7.0.0")
+bazel_dep(name = "ftxui", version = "7.0.1")
 bazel_dep(name = "rules_cc", version = "0.2.17")
 
 local_path_override(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/cmake/ftxui_install.cmake 
new/FTXUI-7.0.1/cmake/ftxui_install.cmake
--- old/FTXUI-7.0.0/cmake/ftxui_install.cmake   2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/cmake/ftxui_install.cmake   2026-07-14 13:59:09.000000000 
+0200
@@ -6,15 +6,42 @@
 include(CMakePackageConfigHelpers)
 
 # 
------------------------------------------------------------------------------
-# Install the library and its public headers into the standard subdirectories
+# Install the library and its public headers into the standard subdirectories.
+# On multi-config generators (e.g. Visual Studio) both Debug and Release are
+# installed into separate lib/<config>/ subdirectories so they can coexist in
+# the same package without overwriting each other.  Single-config generators
+# (Ninja, Make) keep the traditional flat lib/ layout.
+# Generator expressions in DESTINATION require CMake 3.20.
 # 
------------------------------------------------------------------------------
-install(
-  TARGETS screen dom component ftxui
-  EXPORT ftxui-targets
-  ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
-  LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
-  RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+get_property(_ftxui_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(_ftxui_isMultiConfig)
+  if(CMAKE_VERSION VERSION_LESS "3.20")
+    message(WARNING
+      "FTXUI: CMake >= 3.20 is required to install Debug and Release "
+      "libraries into separate subdirectories on multi-config generators. "
+      "Falling back to a flat lib/ layout (the two configurations will "
+      "overwrite each other). Please upgrade CMake.")
+    set(_ftxui_isMultiConfig FALSE)
+  endif()
+endif()
+
+if(_ftxui_isMultiConfig)
+  install(
+    TARGETS screen dom component ftxui
+    EXPORT ftxui-targets
+    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/$<CONFIG>"
+    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/$<CONFIG>"
+    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/$<CONFIG>"
+  )
+else()
+  install(
+    TARGETS screen dom component ftxui
+    EXPORT ftxui-targets
+    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
   )
+endif()
 
 install(
   DIRECTORY include/ftxui
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/cmake/ftxui_set_options.cmake 
new/FTXUI-7.0.1/cmake/ftxui_set_options.cmake
--- old/FTXUI-7.0.0/cmake/ftxui_set_options.cmake       2026-06-13 
23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/cmake/ftxui_set_options.cmake       2026-07-14 
13:59:09.000000000 +0200
@@ -27,19 +27,34 @@
       PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-warnings-as-errors=*"
     )
 
-    # By using "PUBLIC" as opposed to "SYSTEM INTERFACE", the compiler warning
-    # are enforced on the headers. This is behind "FTXUI_CLANG_TIDY", so that 
it
-    # applies only when developing FTXUI and on the CI. User's of the library
-    # get only the SYSTEM INTERFACE instead.
+    # By using "PUBLIC" as opposed to "INTERFACE", the compiler warnings are
+    # enforced on the headers. This is behind "FTXUI_CLANG_TIDY", so that it
+    # applies only when developing FTXUI and on the CI. Users of the library
+    # get only the plain INTERFACE instead.
     target_include_directories(${library}
       PUBLIC
         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
     )
   else()
-    target_include_directories(${library} SYSTEM
-      INTERFACE
-        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
-    )
+    if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+      # Building FTXUI as a standalone project.  Do NOT mark as SYSTEM: if
+      # a sibling FTXUI target (e.g. dom depending on screen) inherits this
+      # path via INTERFACE_SYSTEM_INCLUDE_DIRECTORIES, CMake demotes the
+      # private -I to -isystem.  That path is then searched *after* any -I
+      # added by a package manager (e.g. MacPorts' -I/opt/local/include),
+      # letting a stale installed FTXUI shadow the sources being built.
+      target_include_directories(${library}
+        INTERFACE
+          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+      )
+    else()
+      # Consumed via add_subdirectory / FetchContent: keep SYSTEM so that
+      # consumers do not receive warnings from FTXUI headers.
+      target_include_directories(${library} SYSTEM
+        INTERFACE
+          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+      )
+    endif()
   endif()
 
   target_include_directories(${library} SYSTEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/doc/getting-started.md 
new/FTXUI-7.0.1/doc/getting-started.md
--- old/FTXUI-7.0.0/doc/getting-started.md      2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/doc/getting-started.md      2026-07-14 13:59:09.000000000 
+0200
@@ -21,7 +21,7 @@
 include(FetchContent)
 FetchContent_Declare(ftxui
   GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
-  GIT_TAG main # or a specific version like v7.0.0
+  GIT_TAG main # or a specific version like v7.0.1
 )
 FetchContent_MakeAvailable(ftxui)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/doc/installation_bazel.md 
new/FTXUI-7.0.1/doc/installation_bazel.md
--- old/FTXUI-7.0.0/doc/installation_bazel.md   2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/doc/installation_bazel.md   2026-07-14 13:59:09.000000000 
+0200
@@ -7,7 +7,7 @@
 
 **MODULE.bazel**
 ```starlark
-bazel_dep(name = "ftxui", version = "7.0.0")
+bazel_dep(name = "ftxui", version = "7.0.1")
 ```
 
 **BUILD.bazel**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/doc/installation_cmake.md 
new/FTXUI-7.0.1/doc/installation_cmake.md
--- old/FTXUI-7.0.0/doc/installation_cmake.md   2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/doc/installation_cmake.md   2026-07-14 13:59:09.000000000 
+0200
@@ -15,7 +15,7 @@
 
 FetchContent_Declare(ftxui
   GIT_REPOSITORY https://github.com/ArthurSonzogni/FTXUI
-  GIT_TAG v7.0.0  # Replace with a version, tag, or commit hash
+  GIT_TAG v7.0.1  # Replace with a version, tag, or commit hash
 )
 
 FetchContent_MakeAvailable(ftxui)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/doc/installation_meson.md 
new/FTXUI-7.0.1/doc/installation_meson.md
--- old/FTXUI-7.0.0/doc/installation_meson.md   2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/doc/installation_meson.md   2026-07-14 13:59:09.000000000 
+0200
@@ -88,7 +88,7 @@
 ```ini
 [wrap-git]
 url = https://github.com/ArthurSonzogni/FTXUI.git
-revision = v7.0.0
+revision = v7.0.1
 
 [provide]
 ftxui-screen = ftxui_screen_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/doc/installation_vcpkg.md 
new/FTXUI-7.0.1/doc/installation_vcpkg.md
--- old/FTXUI-7.0.0/doc/installation_vcpkg.md   2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/doc/installation_vcpkg.md   2026-07-14 13:59:09.000000000 
+0200
@@ -14,7 +14,7 @@
   "dependencies": [
     {
         "name": "ftxui",
-        "version>=": "7.0.0"
+        "version>=": "7.0.1"
     }
   ]
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/include/ftxui/screen/screen.hpp 
new/FTXUI-7.0.1/include/ftxui/screen/screen.hpp
--- old/FTXUI-7.0.0/include/ftxui/screen/screen.hpp     2026-06-13 
23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/include/ftxui/screen/screen.hpp     2026-07-14 
13:59:09.000000000 +0200
@@ -34,6 +34,10 @@
   // Destructor:
   ~Screen() override = default;
 
+  // Copy:
+  Screen(const Screen&) = default;
+  Screen& operator=(const Screen&) = default;
+
   std::string ToString() const;
   void ToString(std::string& ss) const;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/include/ftxui/screen/surface.hpp 
new/FTXUI-7.0.1/include/ftxui/screen/surface.hpp
--- old/FTXUI-7.0.0/include/ftxui/screen/surface.hpp    2026-06-13 
23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/include/ftxui/screen/surface.hpp    2026-07-14 
13:59:09.000000000 +0200
@@ -27,6 +27,10 @@
   // Destructor:
   virtual ~Surface() = default;
 
+  // Copy:
+  Surface(const Surface&) = default;
+  Surface& operator=(const Surface&) = default;
+
   // Access a character in the grid at a given position.
   std::string& at(int x, int y);
   const std::string& at(int x, int y) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/src/ftxui/screen/color.cpp 
new/FTXUI-7.0.1/src/ftxui/screen/color.cpp
--- old/FTXUI-7.0.0/src/ftxui/screen/color.cpp  2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/src/ftxui/screen/color.cpp  2026-07-14 13:59:09.000000000 
+0200
@@ -101,7 +101,11 @@
 
 /// @brief Build a color using the Palette16 colors.
 Color::Color(Palette16 index)
-    : type_(ColorType::Palette16), red_(index), alpha_(255) {}
+    : type_(ColorType::Palette16), red_(index), alpha_(255) {
+  if (Terminal::ColorSupport() == Terminal::Color::Palette1) {
+    type_ = ColorType::Palette1;
+  }
+}
 
 /// @brief Build a color using Palette256 colors.
 Color::Color(Palette256 index)
@@ -109,6 +113,10 @@
   if (Terminal::ColorSupport() >= Terminal::Color::Palette256) {
     return;
   }
+  if (Terminal::ColorSupport() == Terminal::Color::Palette1) {
+    type_ = ColorType::Palette1;
+    return;
+  }
   type_ = ColorType::Palette16;
   red_ = GetColorInfo(Color::Palette256(red_)).index_16;
 }
@@ -129,6 +137,10 @@
   if (Terminal::ColorSupport() == Terminal::Color::TrueColor) {
     return;
   }
+  if (Terminal::ColorSupport() == Terminal::Color::Palette1) {
+    type_ = ColorType::Palette1;
+    return;
+  }
 
   // Find the closest Color from the database:
   const int max_distance = 256 * 256 * 3;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/src/ftxui/screen/color_test.cpp 
new/FTXUI-7.0.1/src/ftxui/screen/color_test.cpp
--- old/FTXUI-7.0.0/src/ftxui/screen/color_test.cpp     2026-06-13 
23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/src/ftxui/screen/color_test.cpp     2026-07-14 
13:59:09.000000000 +0200
@@ -3,10 +3,51 @@
 // the LICENSE file.
 #include "ftxui/screen/color.hpp"
 #include <gtest/gtest.h>
+#include <cstdlib>  // for std::getenv, setenv, unsetenv
+#include <optional>
+#include <string>
 #include "ftxui/screen/terminal.hpp"
 
 namespace ftxui {
 
+// Regression test to ensure Color can be constructed statically before main()
+// without causing a static initialization order crash.
+const Color g_test_static_color = Color::RGB(10, 20, 30);
+
+
+
+#if !defined(_WIN32)
+namespace {
+// Clear an environment variable for the duration of a scope, restoring its
+// original value on destruction. ComputeColorSupport reads NO_COLOR and
+// WT_SESSION from the environment; tests must not depend on the machine
+// running them.
+class ScopedClearEnv {
+ public:
+  explicit ScopedClearEnv(const char* name) : name_(name) {
+    const char* value = std::getenv(name);  // NOLINT
+    if (value != nullptr) {
+      saved_ = value;
+    }
+    unsetenv(name);
+  }
+  ~ScopedClearEnv() {
+    if (saved_) {
+      setenv(name_, saved_->c_str(), 1);
+    } else {
+      unsetenv(name_);
+    }
+  }
+  ScopedClearEnv(const ScopedClearEnv&) = delete;
+  ScopedClearEnv& operator=(const ScopedClearEnv&) = delete;
+
+ private:
+  const char* name_;
+  std::optional<std::string> saved_;
+};
+}  // namespace
+#endif
+
 TEST(ColorTest, PrintTransparent) {
   Terminal::SetColorSupport(Terminal::Color::TrueColor);
   EXPECT_EQ(Color().Print(false), "39");
@@ -83,4 +124,86 @@
   EXPECT_EQ(Color::HSV(0, 255, 255).Print(false), "38;2;255;0;0");
 }
 
+TEST(ColorTest, ComputeColorSupport) {
+#if !defined(_WIN32)
+  const ScopedClearEnv no_color("NO_COLOR");
+  const ScopedClearEnv wt_session("WT_SESSION");
+
+  EXPECT_EQ(Terminal::ComputeColorSupport("xterm", "256", "", "", "", {}),
+            Terminal::Color::Palette256);
+  EXPECT_EQ(Terminal::ComputeColorSupport("xterm-256color", "", "", "", "", 
{}),
+            Terminal::Color::Palette256);
+
+  // An unidentified terminal without any hint only gets Palette16.
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "", "unknown", "unknown", 
{}),
+            Terminal::Color::Palette16);
+  // An empty terminal name is treated as unidentified.
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "", "", "", {}),
+            Terminal::Color::Palette16);
+
+  // Apple's Terminal.app supports 256 colors, but not 24bit ones.
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "Apple_Terminal", "unknown",
+                                          "unknown", {}),
+            Terminal::Color::Palette256);
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "iTerm.app", "unknown",
+                                          "unknown", {}),
+            Terminal::Color::TrueColor);
+#endif
+  EXPECT_EQ(Terminal::ComputeColorSupport("xterm", "truecolor", "", "", "", 
{}),
+            Terminal::Color::TrueColor);
+  EXPECT_EQ(Terminal::ComputeColorSupport("kitty", "", "", "", "", {}),
+            Terminal::Color::TrueColor);
+}
+
+#if !defined(_WIN32)
+TEST(ColorTest, ComputeColorSupportWTSession) {
+  const ScopedClearEnv no_color("NO_COLOR");
+  const ScopedClearEnv wt_session("WT_SESSION");
+
+  // Without WT_SESSION, an unidentified terminal only gets Palette16.
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "", "unknown", "unknown", 
{}),
+            Terminal::Color::Palette16);
+
+  // Windows Terminal sets WT_SESSION, including when running under WSL.
+  setenv("WT_SESSION", "test_session_id", 1);
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "", "unknown", "unknown", 
{}),
+            Terminal::Color::TrueColor);
+}
+
+TEST(ColorTest, ComputeColorSupportNoColor) {
+  const ScopedClearEnv no_color("NO_COLOR");
+  const ScopedClearEnv wt_session("WT_SESSION");
+
+  // NO_COLOR (https://no-color.org) disables colors, even on a TrueColor
+  // capable terminal.
+  setenv("NO_COLOR", "1", 1);
+  EXPECT_EQ(Terminal::ComputeColorSupport("xterm", "truecolor", "", "unknown",
+                                          "unknown", {}),
+            Terminal::Color::Palette1);
+
+  // NO_COLOR takes precedence over WT_SESSION.
+  setenv("WT_SESSION", "test_session_id", 1);
+  EXPECT_EQ(Terminal::ComputeColorSupport("", "", "", "unknown", "unknown", 
{}),
+            Terminal::Color::Palette1);
+
+  // An empty NO_COLOR is the same as an unset one.
+  setenv("NO_COLOR", "", 1);
+  unsetenv("WT_SESSION");
+  EXPECT_EQ(Terminal::ComputeColorSupport("xterm", "truecolor", "", "unknown",
+                                          "unknown", {}),
+            Terminal::Color::TrueColor);
+}
+#endif
+
+TEST(ColorTest, FallbackToPalette1) {
+  Terminal::SetColorSupport(Terminal::Color::Palette1);
+  // Every color degrades to the terminal's default colors.
+  EXPECT_EQ(Color(Color::Red).Print(false), "39");
+  EXPECT_EQ(Color(Color::Red).Print(true), "49");
+  EXPECT_EQ(Color(Color::DarkRed).Print(false), "39");
+  EXPECT_EQ(Color::RGB(1, 2, 3).Print(false), "39");
+  EXPECT_EQ(Color::RGB(1, 2, 3).Print(true), "49");
+  Terminal::SetColorSupport(Terminal::Color::TrueColor);
+}
+
 }  // namespace ftxui
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/src/ftxui/screen/screen.cpp 
new/FTXUI-7.0.1/src/ftxui/screen/screen.cpp
--- old/FTXUI-7.0.0/src/ftxui/screen/screen.cpp 2026-06-13 23:37:17.000000000 
+0200
+++ new/FTXUI-7.0.1/src/ftxui/screen/screen.cpp 2026-07-14 13:59:09.000000000 
+0200
@@ -57,7 +57,12 @@
   auto stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
 
   DWORD out_mode = 0;
-  GetConsoleMode(stdout_handle, &out_mode);
+  if (!GetConsoleMode(stdout_handle, &out_mode)) {
+    // The output is not a console (e.g. redirected to a file or a pipe). Keep
+    // the detected color support and let the consumer of the stream interpret
+    // the escape sequences.
+    return;
+  }
 
   // https://docs.microsoft.com/en-us/windows/console/setconsolemode
   const int enable_virtual_terminal_processing = 0x0004;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/src/ftxui/screen/terminal.cpp 
new/FTXUI-7.0.1/src/ftxui/screen/terminal.cpp
--- old/FTXUI-7.0.0/src/ftxui/screen/terminal.cpp       2026-06-13 
23:37:17.000000000 +0200
+++ new/FTXUI-7.0.1/src/ftxui/screen/terminal.cpp       2026-07-14 
13:59:09.000000000 +0200
@@ -30,16 +30,24 @@
 
 namespace {
 
-bool g_color_support_detected = false;  // NOLINT
-Terminal::Quirks g_quirks = [] {        // NOLINT
-  Terminal::Quirks quirks;
+std::unique_ptr<Terminal::Quirks> g_quirks;
+bool g_color_support_detected = false;
+
+bool& ColorSupportDetected() {
+  return g_color_support_detected;
+}
+
+Terminal::Quirks& GetQuirksInternal() {
+  if (!g_quirks) {
+    g_quirks = std::make_unique<Terminal::Quirks>();
 #if defined(_WIN32)
-  quirks.SetBlockCharacters(false);
-  quirks.SetCursorHiding(false);
-  quirks.SetComponentAscii(true);
+    g_quirks->SetBlockCharacters(false);
+    g_quirks->SetCursorHiding(false);
+    g_quirks->SetComponentAscii(true);
 #endif
-  return quirks;
-}();
+  }
+  return *g_quirks;
+}
 
 Dimensions& FallbackSize() {
 #if defined(__EMSCRIPTEN__)
@@ -209,12 +217,44 @@
 }
 
 Color TerminalInfo::ComputeColorSupport() const {
-  // 0. Platform specific overrides.
+  // TODO(v8): Read NO_COLOR and WT_SESSION from ComputeColorSupportInternal()
+  // and pass them in as parameters, so that this function remains a pure
+  // function of its inputs. This requires extending the public
+  // Terminal::ComputeColorSupport() signature, i.e. an API-breaking change.
+
+  // 0. User preference. See https://no-color.org.
+  const char* no_color = std::getenv("NO_COLOR");  // NOLINT
+  if (no_color != nullptr && no_color[0] != '\0') {
+    return Terminal::Color::Palette1;
+  }
+
+  // 1. Platform specific overrides.
 #if defined(__EMSCRIPTEN__)
   return Terminal::Color::TrueColor;
 #endif
+#if defined(_WIN32)
+  // Check if we are running in a console, and if that console supports VT 
processing.
+  auto stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
+  DWORD out_mode = 0;
+  if (GetConsoleMode(stdout_handle, &out_mode)) {
+    const int enable_virtual_terminal_processing = 0x0004;
+    const int disable_newline_auto_return = 0x0008;
+    out_mode |= enable_virtual_terminal_processing;
+    out_mode |= disable_newline_auto_return;
+    if (!SetConsoleMode(stdout_handle, out_mode)) {
+      return Terminal::Color::Palette16;
+    }
+  }
+  return Terminal::Color::TrueColor;
+#endif
+
+  // Check WT_SESSION for Windows Terminal (e.g. when running under WSL).
+  const char* wt_session = std::getenv("WT_SESSION");  // NOLINT
+  if (wt_session != nullptr && wt_session[0] != '\0') {
+    return Terminal::Color::TrueColor;
+  }
 
-  // 1. term / colorterm environment variables.
+  // 2. term / colorterm environment variables.
   if (ContainsAny(impl_->colorterm, {"24bit", "truecolor"})) {
     return Terminal::Color::TrueColor;
   }
@@ -227,10 +267,9 @@
     return Terminal::Color::Palette256;
   }
 
-  // 2. term_program
+  // 3. term_program
   if (ContainsAny(impl_->term_program, {
                                            "iterm",
-                                           "apple_terminal",
                                            "vscode",
                                            "warp",
                                            "ghostty",
@@ -238,12 +277,17 @@
                                        })) {
     return Terminal::Color::TrueColor;
   }
-  if (Contains(impl_->term_program, "iterm")) {
+  // Apple's Terminal.app (TERM_PROGRAM=Apple_Terminal) supports 256 colors,
+  // but not 24bit ones.
+  if (Contains(impl_->term_program, "apple_terminal")) {
     return Terminal::Color::Palette256;
   }
 
-  // 3. terminal identification.
-  if (impl_->terminal_emulator_name != "unknown") {
+  // 4. terminal identification.
+  // An empty name means the terminal was not identified, the same as
+  // "unknown".
+  if (!impl_->terminal_emulator_name.empty() &&
+      impl_->terminal_emulator_name != "unknown") {
     return Terminal::Color::TrueColor;
   }
   if (impl_->terminal_name == "xterm") {
@@ -302,35 +346,35 @@
 /// @brief Get the color support of the terminal.
 /// @ingroup screen
 Color ColorSupport() {
-  if (!g_color_support_detected) {
-    g_quirks.SetColorSupport(ComputeColorSupportInternal());
-    g_color_support_detected = true;
+  if (!ColorSupportDetected()) {
+    GetQuirksInternal().SetColorSupport(ComputeColorSupportInternal());
+    ColorSupportDetected() = true;
   }
-  return g_quirks.ColorSupport();
+  return GetQuirksInternal().ColorSupport();
 }
 
 /// @brief Override terminal color support in case auto-detection fails
 /// @ingroup dom
 void SetColorSupport(Color color) {
-  g_quirks.SetColorSupport(color);
-  g_color_support_detected = true;
+  GetQuirksInternal().SetColorSupport(color);
+  ColorSupportDetected() = true;
 }
 
 /// @brief Get the terminal quirks.
 /// @ingroup screen
 Quirks GetQuirks() {
-  if (!g_color_support_detected) {
-    g_quirks.SetColorSupport(ComputeColorSupportInternal());
-    g_color_support_detected = true;
+  if (!ColorSupportDetected()) {
+    GetQuirksInternal().SetColorSupport(ComputeColorSupportInternal());
+    ColorSupportDetected() = true;
   }
-  return g_quirks;
+  return GetQuirksInternal();
 }
 
 /// @brief Override terminal quirks.
 /// @ingroup screen
 void SetQuirks(const Quirks& quirks) {
-  g_quirks = quirks;
-  g_color_support_detected = true;
+  GetQuirksInternal() = quirks;
+  ColorSupportDetected() = true;
 }
 
 }  // namespace Terminal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/tools/windows-vm/provision.ps1 
new/FTXUI-7.0.1/tools/windows-vm/provision.ps1
--- old/FTXUI-7.0.0/tools/windows-vm/provision.ps1      1970-01-01 
01:00:00.000000000 +0100
+++ new/FTXUI-7.0.1/tools/windows-vm/provision.ps1      2026-07-14 
13:59:09.000000000 +0200
@@ -0,0 +1,59 @@
+# Provision a Windows 11 guest for building and testing FTXUI.
+# Run from an elevated terminal inside the VM, bootstrapped by
+# ../windows-vm.sh provision:
+#
+#     irm http://10.0.2.2:8123/provision.ps1 | iex
+#
+# Installs the OpenSSH server (so the Linux host can drive the guest), then
+# Git, CMake and the MSVC Build Tools. Writes %USERPROFILE%\provision-done.txt
+# when finished; the host polls for that file.
+$ErrorActionPreference = 'Stop'
+$hostUrl = 'http://10.0.2.2:8123'  # Linux host, as seen from QEMU user 
networking.
+
+$isAdmin = ([Security.Principal.WindowsPrincipal] `
+  [Security.Principal.WindowsIdentity]::GetCurrent()
+).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
+if (-not $isAdmin) {
+  throw 'This script must run from an elevated (Admin) terminal.'
+}
+
+Write-Host '=== [1/3] OpenSSH server ==='
+Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | Out-Null
+Set-Service -Name sshd -StartupType Automatic
+Start-Service sshd
+if (-not (Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -ErrorAction 
SilentlyContinue)) {
+  New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' `
+    -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound `
+    -Protocol TCP -Action Allow -LocalPort 22 -Profile Any | Out-Null
+} else {
+  Set-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -Profile Any
+}
+
+# Ensure SPICE agent and WebDAV services are set to Automatic and running
+Get-Service -Name spice-agent, spice-webdavd -ErrorAction SilentlyContinue | 
ForEach-Object {
+  Set-Service -Name $_.Name -StartupType Automatic
+  Start-Service $_.Name -ErrorAction SilentlyContinue
+}
+
+
+# Install the host's public key. Administrator accounts use a shared,
+# strictly-ACLed authorized_keys file. Use SIDs (S-1-5-32-544 =
+# Administrators, S-1-5-18 = SYSTEM) so this works on localized Windows.
+$authKeys = 'C:\ProgramData\ssh\administrators_authorized_keys'
+Invoke-RestMethod "$hostUrl/id_ed25519.pub" | Out-File -Encoding ascii 
$authKeys
+icacls $authKeys /inheritance:r /grant '*S-1-5-32-544:F' /grant '*S-1-5-18:F' 
| Out-Null
+Write-Host 'sshd is running; the host can now reach this guest.'
+
+Write-Host '=== [2/3] Git and CMake ==='
+winget install --id Git.Git -e --silent `
+  --accept-package-agreements --accept-source-agreements
+winget install --id Kitware.CMake -e --silent `
+  --accept-package-agreements --accept-source-agreements
+
+Write-Host '=== [3/3] MSVC Build Tools (~3GB, this is the slow part) ==='
+winget install --id Microsoft.VisualStudio.2022.BuildTools -e --silent `
+  --accept-package-agreements --accept-source-agreements `
+  --override '--quiet --wait --norestart --nocache --add 
Microsoft.VisualStudio.Workload.VCTools --includeRecommended'
+
+New-Item -ItemType File -Force "$env:USERPROFILE\provision-done.txt" | Out-Null
+Write-Host 'Provisioning done. You can go back to the Linux terminal.'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FTXUI-7.0.0/tools/windows-vm.sh 
new/FTXUI-7.0.1/tools/windows-vm.sh
--- old/FTXUI-7.0.0/tools/windows-vm.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/FTXUI-7.0.1/tools/windows-vm.sh 2026-07-14 13:59:09.000000000 +0200
@@ -0,0 +1,262 @@
+#!/usr/bin/env bash
+# Create and drive a Windows 11 VM (QEMU/KVM via quickemu) to build and run
+# the FTXUI tests on Windows, from a Linux host.
+#
+# Usage:
+#   ./tools/windows-vm.sh setup      # install quickemu + download Windows 11
+#   ./tools/windows-vm.sh start      # boot the VM (first boot auto-installs)
+#   ./tools/windows-vm.sh provision  # set up ssh + build tools in the guest
+#   ./tools/windows-vm.sh test       # upload the working tree, build, run 
tests
+#   ./tools/windows-vm.sh ssh [cmd]  # interactive shell / run a command
+#   ./tools/windows-vm.sh status     # check whether the guest is reachable
+#
+# The only manual step is during `provision`: Windows provides no channel for
+# automation until ssh is installed, so you must type one bootstrap command in
+# a terminal inside the VM. Everything before and after is automated.
+set -euo pipefail
+
+ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+VM_DIR="$ROOT/tools/windows-vm/data"
+PROVISION_PS1="$ROOT/tools/windows-vm/provision.ps1"
+KEY="$VM_DIR/id_ed25519"
+
+# quickemu forwards the guest ssh port to 22220 on the host by default.
+SSH_PORT=22220
+SSH_USER=Quickemu  # user created by quickget's unattended Windows install.
+# The guest reaches the host at 10.0.2.2 (QEMU user networking). Must match
+# the URL hardcoded in provision.ps1.
+HTTP_PORT=8123
+
+SSH_OPTS=(
+  -i "$KEY"
+  -p "$SSH_PORT"
+  -o StrictHostKeyChecking=no
+  -o UserKnownHostsFile="$VM_DIR/known_hosts"
+  -o ConnectTimeout=5
+  -o LogLevel=ERROR
+)
+
+run_ssh() {
+  ssh "${SSH_OPTS[@]}" "$SSH_USER@localhost" "$@"
+}
+
+guest_reachable() {
+  run_ssh "exit" 2>/dev/null
+}
+
+guest_provisioned() {
+  run_ssh "cmd /c if exist provision-done.txt echo DONE" 2>/dev/null | grep -q 
"DONE"
+}
+
+# quickget downloads with a browser-like user agent, which the anti-bot proxy
+# in front of fedorapeople.org rejects: it saves an HTML challenge page as
+# virtio-win.iso. curl's default user agent passes through, so fetch the ISO
+# ourselves when quickget's copy is missing or bogus (a real one is >500MB).
+fetch_virtio() {
+  local iso="$VM_DIR/windows-11/virtio-win.iso"
+  if [ -f "$iso" ] && [ "$(stat -c %s "$iso")" -gt 100000000 ]; then
+    return
+  fi
+  echo "Fetching virtio-win.iso (quickget's copy is missing or not an ISO)..."
+  rm -f "$iso"
+  curl -L --fail --progress-bar -o "$iso" \
+    
https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
+}
+
+# quickget's autounattend.xml has two driver paths that break Windows 11
+# 24H2+ installs (quickemu-project/quickemu#1475 and #1620): E:\amd64\w10
+# loads vioscsi/viostor a second time, failing setup with 0x80070103, and
+# viogpudo in the windowsPE pass causes a black screen. Drop both, and
+# reinstall viogpudo at first logon instead.
+patch_unattended() {
+  local xml="$VM_DIR/windows-11/unattended/autounattend.xml"
+  [ -f "$xml" ] || return 0
+  if ! grep -q "quickemu#1620" "$xml"; then
+    echo "Patching autounattend.xml (quickemu#1475, quickemu#1620)..."
+    python3 - "$xml" <<'PYEOF'
+import re
+import sys
+
+path = sys.argv[1]
+s = open(path).read()
+
+for driver in (r'E:\amd64\w10', r'E:\viogpudo\w10\amd64'):
+    pattern = re.compile(
+        r'\s*<PathAndCredentials wcm:action="add" wcm:keyValue="\d+">\s*'
+        r'<Path>' + re.escape(driver) + r'</Path>\s*'
+        r'</PathAndCredentials>')
+    s = pattern.sub('', s)
+
+addition = '''        <SynchronousCommand wcm:action="add">
+          <CommandLine>pnputil /add-driver 
E:\\viogpudo\\w10\\amd64\\viogpudo.inf /install</CommandLine>
+          <Description>Install virtio GPU driver (skipped during windowsPE, 
quickemu#1620)</Description>
+          <Order>6</Order>
+        </SynchronousCommand>
+      </FirstLogonCommands>'''
+s = s.replace('      </FirstLogonCommands>', addition)
+
+open(path, 'w').write(s)
+PYEOF
+  fi
+  genisoimage -quiet -o "$VM_DIR/windows-11/unattended.iso" -V CDROM -J -R \
+    "$VM_DIR/windows-11/unattended/"
+}
+
+cmd_setup() {
+  if ! command -v quickemu >/dev/null; then
+    echo "Installing quickemu..."
+    sudo apt-get install -y quickemu || {
+      echo "quickemu not in the archive; using the maintainer's PPA."
+      sudo add-apt-repository -y ppa:flexiondotorg/quickemu
+      sudo apt-get update
+      sudo apt-get install -y quickemu
+    }
+  fi
+
+  local free_gb
+  free_gb=$(df --output=avail -BG "$ROOT" | tail -1 | tr -dc '0-9')
+  if [ "$free_gb" -lt 50 ]; then
+    echo "WARNING: only ${free_gb}G free. The VM can grow to ~40G." >&2
+  fi
+
+  mkdir -p "$VM_DIR"
+  if [ ! -e "$VM_DIR/windows-11/windows-11.iso" ]; then
+    echo "Downloading the Windows 11 ISO (several GB, this takes a while)..."
+    (cd "$VM_DIR" && quickget windows 11) || true
+  fi
+  fetch_virtio
+  patch_unattended
+
+  # quickget can fail silently (e.g. blocked downloads); verify the result.
+  local f
+  for f in windows-11.conf windows-11/windows-11.iso 
windows-11/virtio-win.iso; do
+    [ -s "$VM_DIR/$f" ] || {
+      echo "ERROR: $f is missing; the download failed. See output above." >&2
+      exit 1
+    }
+  done
+  echo
+  echo "Done. Next: ./tools/windows-vm.sh start"
+  echo "The first boot runs the unattended Windows install (15-30 min)."
+}
+
+cmd_start() {
+  [ -e "$VM_DIR/windows-11.conf" ] || {
+    echo "No VM found. Run: ./tools/windows-vm.sh setup" >&2
+    exit 1
+  }
+  (cd "$VM_DIR" && quickemu --vm windows-11.conf --display spice)
+}
+
+cmd_provision() {
+  if guest_reachable && guest_provisioned; then
+    echo "Guest is already provisioned."
+    return
+  fi
+
+  [ -f "$KEY" ] || ssh-keygen -t ed25519 -N '' -f "$KEY" -C ftxui-windows-vm
+
+  # Serve the provisioning script and the public key to the guest over HTTP.
+  local serve_dir
+  serve_dir=$(mktemp -d)
+  cp "$PROVISION_PS1" "$serve_dir/provision.ps1"
+  cp "$KEY.pub" "$serve_dir/id_ed25519.pub"
+  python3 -m http.server "$HTTP_PORT" --directory "$serve_dir" --bind 0.0.0.0 \
+    >/dev/null 2>&1 &
+  local server_pid=$!
+  # shellcheck disable=SC2064
+  trap "kill $server_pid 2>/dev/null; rm -rf '$serve_dir'" EXIT
+
+  cat <<EOF
+
+In the VM, open «Terminal (Admin)» (right click on the start menu), and run:
+
+    irm http://10.0.2.2:$HTTP_PORT/provision.ps1 | iex
+
+This installs the ssh server, then Git, CMake and the MSVC Build Tools
+(~3GB download, expect 15-45 min). Waiting for it to complete...
+
+EOF
+
+  local start elapsed
+  start=$(date +%s)
+  until guest_reachable && guest_provisioned; do
+    sleep 15
+    elapsed=$(( ($(date +%s) - start) / 60 ))
+    echo "  ... still waiting (${elapsed} min). VS Build Tools install is 
slow."
+    if [ "$elapsed" -ge 90 ]; then
+      echo "Timed out after 90 min. Check the VM window for errors." >&2
+      exit 1
+    fi
+  done
+  echo "Guest provisioned and reachable over ssh."
+  echo "Next: ./tools/windows-vm.sh test"
+}
+
+cmd_test() {
+  guest_reachable || {
+    echo "Guest not reachable. Is the VM started and provisioned?" >&2
+    exit 1
+  }
+
+  local cmake='"C:\Program Files\CMake\bin\cmake.exe"'
+  local ctest='"C:\Program Files\CMake\bin\ctest.exe"'
+
+  echo "Uploading the working tree (tracked files, including local changes)..."
+  git -C "$ROOT" ls-files -z |
+    tar -C "$ROOT" --null -T - -czf - |
+    run_ssh "cmd /c (if exist ftxui-src rmdir /s /q ftxui-src) & mkdir 
ftxui-src & tar xzf - -C ftxui-src"
+
+  echo "Configuring (MSVC is auto-detected by CMake)..."
+  run_ssh "$cmake -S ftxui-src -B ftxui-build -DFTXUI_BUILD_TESTS=ON 
-DFTXUI_BUILD_EXAMPLES=ON"
+
+  echo "Building..."
+  run_ssh "$cmake --build ftxui-build --config Release --parallel"
+
+  echo "Running the tests..."
+  run_ssh "$ctest --test-dir ftxui-build -C Release --output-on-failure"
+
+  cat <<'EOF'
+
+Automated tests passed. Manual visual checks, inside the VM:
+
+  Windows Terminal (TrueColor gradients, issue #1305) - run in PowerShell:
+    
C:\Users\Quickemu\ftxui-build\examples\component\Release\ftxui_example_button_style.exe
+
+  Classic conhost (no WT_SESSION, must still be TrueColor) - run in PowerShell:
+    conhost.exe 
C:\Users\Quickemu\ftxui-build\examples\component\Release\ftxui_example_button_style.exe
+
+  Redirected output (GetConsoleMode failure path) - run in cmd.exe (Command 
Prompt):
+    
C:\Users\Quickemu\ftxui-build\examples\dom\Release\ftxui_example_color_gallery.exe
 > out.txt & type out.txt
+EOF
+}
+
+cmd_ssh() {
+  if [ $# -eq 0 ]; then
+    ssh "${SSH_OPTS[@]}" "$SSH_USER@localhost"
+  else
+    run_ssh "$@"
+  fi
+}
+
+cmd_status() {
+  if guest_reachable; then
+    if guest_provisioned; then
+      echo "Guest is reachable and provisioned."
+    else
+      echo "Guest is reachable but not provisioned yet."
+    fi
+  else
+    echo "Guest is not reachable on port $SSH_PORT."
+  fi
+}
+
+case "${1:-help}" in
+  setup) cmd_setup ;;
+  start) cmd_start ;;
+  provision) cmd_provision ;;
+  test) shift; cmd_test "$@" ;;
+  ssh) shift; cmd_ssh "$@" ;;
+  status) cmd_status ;;
+  *) grep '^#' "$0" | head -17 | sed 's/^# \?//' ;;
+esac

Reply via email to