Skip to content

Commit

Permalink
Change colors terminfo entry from 256 up to 32767 colors
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Parpart <[email protected]>
  • Loading branch information
christianparpart committed Jan 2, 2025
1 parent bfb3444 commit 4bf903c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<li>Fixes backtab (Shift+Tab) handling (#1685)</li>
<li>Fixes various spelling typos across the codebase (#1688)</li>
<li>Improve tab close handling to better select previously focused tab</li>
<li>Change `colors` terminfo entry from 256 up to 32767 colors</li>
<li>Add action `SwitchToPreviousTab` to switch to the previously focused tab</li>
</ul>
</description>
Expand Down
12 changes: 7 additions & 5 deletions src/vtbackend/Capabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int16_t>::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 {};
Expand Down
2 changes: 1 addition & 1 deletion src/vtbackend/Capabilities_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int16_t>::max());

auto const bce = tcap.numericCapability("bce");
REQUIRE(bce);
Expand Down

0 comments on commit 4bf903c

Please sign in to comment.