feat: add per-session :theme colour command#61
Merged
Conversation
Add a pure theme registry (theme.c/.h) of 7 portable 16-colour accent palettes (cyan default, green, magenta, blue, amber, red, mono) and a per-client theme index. The new :theme command (alias :color) shows the current theme and available names, or switches the session's accent. Theming is a personalization only: it changes what the choosing user sees (self-gutter marker, /me messages, INSERT mode chip, MOTD frame, :users/:inbox titles) and never affects other users or server state, in keeping with TNT's unrestricted, anonymous design. Covered by theme unit tests and an interactive :theme regression case; docs and man page updated in the same change set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a per-session colour theme command (
:theme, alias:color) — the first item from the "more chat commands" direction, aligned with TNT's unrestricted, anonymous design (personalization only, never affects other users or server state).theme.c/theme.h: 7 portable 16-colour accent palettes — cyan (default), green, magenta, blue, amber, red, mono.theme_index(defaults to cyan; resolved with clamping).:themeshows current theme + available names;:theme <name>switches the session accent; unknown names are rejected with the available list./memessages, INSERT mode chip, MOTD frame,:users/:inboxtitles.Why themes (global parity)
ssh-chat and similar SSH chat servers let users pick colour themes; this brings parity while staying within the 16-colour space so hierarchy never depends on truecolor (2025 TUI best practice).
Tests
tests/unit/test_theme.c— registry, lookup, clamping, name listing (10 cases).tests/test_interactive_input.sh— new:themeregression case (status / switch / reject).test_manual_text.cfor the new group-3 command.:theme,:theme green,:theme bogusover SSH.Docs
README, QUICKREF, and
tnt.1updated in the same change set.