Skip to content

Nepeta mode: purrfect cat-speak reskin (closes #17) - #24

Merged
melogtm merged 3 commits into
mainfrom
feature/nepeta-mode
Aug 2, 2026
Merged

Nepeta mode: purrfect cat-speak reskin (closes #17)#24
melogtm merged 3 commits into
mainfrom
feature/nepeta-mode

Conversation

@melogtm

@melogtm melogtm commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds an opt-in Nepeta mode — a lighthearted easter egg that reskins trigger's own generated output with Nepeta Leijon's cat-speak quirk from Homestuck. When enabled, the shell prefix message, prompt, help text, and certain builtin error/status messages get cat-faced and pun-translated.

Toggle via env var or builtin:

# Enable at startup
TRIGGER_NEPETA=1 ./cmake-build-debug/shell
# Or toggle during a session
nepeta on
nepeta off
nepeta status
nepeta        # bare = toggle

Scope boundary

Only trigger's own output is affected:

  • Prompt changes from > to :33 <
  • Startup banner shows a random Nepeta quote
  • Help text and certain builtin messages (cd no-args error, exit invalid-code error) pass through pun translation
  • External program output, pipeline data, perror()/strerror(), and builtin name listings are never touched

When Nepeta mode is disabled (the default), all output is byte-identical to the previous behavior.

Pun dictionary

Whole-word alpha-run matching with case preservation on first letter:

for→fur, perfect→purrfect, great→clawesome, awesome→pawsome, friend→furriend, now→meow, help→halp

Files changed

File Change
include/nepeta.h (new) Header: getter/setter, init-from-env, prompt, banner, translate, say, random_quote
src/nepeta.c (new) Implementation of pun translation engine and all Nepeta-mode functions
include/builtins.h Declare trigger_nepeta
src/builtins.c Add nepeta builtin, route cd/help/exit messages through trigger_nepeta_say
src/main.c Use trigger_nepeta_prompt(), call init_from_env + print_banner at startup
CMakeLists.txt Add nepeta.c/nepeta.h, new test_nepeta target
tests/test_nepeta.c (new) 18 tests: state, prompt, translate, say capture, random quote, env init
tests/test_builtins.c Bump count to 8, add nepeta find+fn-pointer check, 5 dispatch tests

Closes #17

- New include/nepeta.h and src/nepeta.c: opt-in cat-speak reskin of
  prompt, banner, help text, and builtin error/status messages
- Nepeta mode is toggleable via TRIGGER_NEPETA env var ('1'/'yes'/etc
  enables) or the new 'nepeta' builtin (on/off/status/bare)
- Whole-word alpha-run pun translation: for→fur, perfect→purrfect,
  great→clawesome, awesome→pawsome, friend→furriend, now→meow, help→halp
- When disabled, trigger_nepeta_say delegates to fputs — all existing
  output is byte-identical; no pipelines, external programs, perror(),
  or builtin name listings are affected
- Tests: 18 new NepetaTests (state, prompt, translate, say capture,
  env init) + 6 new builtin dispatch tests (count bumped to 8)
Copilot AI review requested due to automatic review settings August 2, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an opt-in “Nepeta mode” easter egg that reskins Trigger’s own generated output (prompt/banner/help and selected builtin messages) using a cat-speak/pun translation layer, while keeping normal behavior unchanged when disabled.

Changes:

  • Added a new Nepeta module (nepeta.h / nepeta.c) implementing enable/disable state, prompt/banner output, and word-level translation.
  • Added a new nepeta builtin and routed some builtin output through the Nepeta “say” helper.
  • Added a dedicated Nepeta test suite and extended builtin tests; integrated the new module and tests into CMake/CTest.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_nepeta.c New module-level tests for Nepeta enable state, prompt, translation, say, quotes, and env init.
tests/test_builtins.c Adds coverage for the new nepeta builtin and updates builtin count/lookup assertions.
src/nepeta.c Implements Nepeta state, translation engine, prompt/banner, and random quotes.
src/main.c Initializes Nepeta from env and switches prompt rendering to Nepeta-aware prompt helper.
src/builtins.c Registers nepeta builtin and routes selected builtin output through Nepeta-aware output.
include/nepeta.h New public header for Nepeta APIs.
include/builtins.h Declares the new trigger_nepeta builtin function.
CMakeLists.txt Adds src/nepeta.c / include/nepeta.h and introduces test_nepeta in the test target list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/nepeta.c
Comment thread src/builtins.c
@melogtm
melogtm merged commit 1144730 into main Aug 2, 2026
3 checks passed
@melogtm
melogtm deleted the feature/nepeta-mode branch August 2, 2026 15:56
@DuAlmeida995

Copy link
Copy Markdown
image

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.

Make it purrfect

3 participants