Skip to content

feat: add per-session :theme colour command#61

Merged
m1ngsama merged 1 commit into
mainfrom
feat/theme-command
Jun 29, 2026
Merged

feat: add per-session :theme colour command#61
m1ngsama merged 1 commit into
mainfrom
feat/theme-command

Conversation

@m1ngsama

Copy link
Copy Markdown
Owner

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).

  • New pure theme registry theme.c/theme.h: 7 portable 16-colour accent palettes — cyan (default), green, magenta, blue, amber, red, mono.
  • Per-client theme_index (defaults to cyan; resolved with clamping).
  • :theme shows current theme + available names; :theme <name> switches the session accent; unknown names are rejected with the available list.
  • Themed surfaces: self-gutter marker, /me messages, INSERT mode chip, MOTD frame, :users/:inbox titles.

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 :theme regression case (status / switch / reject).
  • Updated test_manual_text.c for the new group-3 command.
  • Full unit suite + interactive + docs-surface tests pass on macOS and on the Linux deploy host.
  • Built and deployed to aliyun.m1ng.space:2222; live-tested :theme, :theme green, :theme bogus over SSH.

Docs

README, QUICKREF, and tnt.1 updated in the same change set.

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.
@m1ngsama m1ngsama merged commit 8df084f into main Jun 29, 2026
5 checks passed
@m1ngsama m1ngsama deleted the feat/theme-command branch June 29, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant