diff --git a/metainfo.xml b/metainfo.xml
index aae9ac06e4..cf9e1c26bb 100644
--- a/metainfo.xml
+++ b/metainfo.xml
@@ -126,6 +126,7 @@
Fixes backtab (Shift+Tab) handling (#1685)
Fixes various spelling typos across the codebase (#1688)
Improve tab close handling to better select previously focused tab
+ Change `colors` terminfo entry from 256 up to 32767 colors
Add action `SwitchToPreviousTab` to switch to the previously focused tab
diff --git a/src/vtbackend/Capabilities.cpp b/src/vtbackend/Capabilities.cpp
index 0e0f13c3e1..de6e42c02d 100644
--- a/src/vtbackend/Capabilities.cpp
+++ b/src/vtbackend/Capabilities.cpp
@@ -91,12 +91,14 @@ namespace
Boolean { "Tc"_tcap, "Tc"sv, true } // RGB color support (introduced by Tmux in 2016)
);
+ constexpr inline auto Int16Max = std::numeric_limits::max();
+
constexpr inline auto NumericalCaps = defineCapabilities(
- Numeric { "co"_tcap, "cols"sv, 80 }, // number of columns in a line
- Numeric { "it"_tcap, "it"sv, 8 }, // tabs initially every # spaces
- Numeric { "Co"_tcap, "colors"sv, 256 }, // maximum number of colors on screen
- Numeric { "pa"_tcap, "pairs"sv, 32767 }, // maximum number of color-pairs on the screen
- Numeric { "li"_tcap, "lines"sv, 24 } // default number of lines in a terminal
+ Numeric { "co"_tcap, "cols"sv, 80 }, // number of columns in a line
+ Numeric { "it"_tcap, "it"sv, 8 }, // tabs initially every # spaces
+ Numeric { "Co"_tcap, "colors"sv, Int16Max }, // maximum number of colors on screen
+ Numeric { "pa"_tcap, "pairs"sv, Int16Max }, // maximum number of color-pairs on the screen
+ Numeric { "li"_tcap, "lines"sv, 24 } // default number of lines in a terminal
);
constexpr auto inline Undefined = Code {};
diff --git a/src/vtbackend/Capabilities_test.cpp b/src/vtbackend/Capabilities_test.cpp
index fff49aeb7b..b2c33c939b 100644
--- a/src/vtbackend/Capabilities_test.cpp
+++ b/src/vtbackend/Capabilities_test.cpp
@@ -27,7 +27,7 @@ TEST_CASE("Capabilities.get")
REQUIRE(rgb == "8/8/8");
auto const colors = tcap.numericCapability("colors");
- REQUIRE(colors == 256);
+ REQUIRE(colors == std::numeric_limits::max());
auto const bce = tcap.numericCapability("bce");
REQUIRE(bce);