Commit Graph

148 Commits

Author SHA1 Message Date
rootiest 7564604c53 fix(zellij): repair scrollback logging on shell exit
The zellij wrapper (functions/zellij.fish) rewrote every `zellij`
invocation as `zellij options --theme catppuccin-mocha <args>`, which is
only valid for launching a new session. This mangled every subcommand,
including the `zellij action dump-screen` call inside _zellij_dump_log,
so no logs were ever produced. The theme is already set in config.kdl,
making the wrapper redundant — remove it.

Also harden _zellij_dump_log:
- dump-screen takes the file via stdout redirect, not a positional arg
  (rejected by zellij 0.44) nor --path (server-side write, flaky)
- add --ansi to preserve color in the logs
- discard empty dumps instead of leaving junk files

Document the structural limitation: zellij can only snapshot on a clean
shell exit, unlike tmux's continuous pipe-pane stream. Closing a pane or
quitting zellij tears down the pane/server before it can be dumped.
2026-06-16 15:05:41 -04:00
rootiest 78df24cba1 fix(kitty): harden kitty-logging install/uninstall/dismiss
- abort install if the watcher copy fails (was wiring a block pointing at
  a missing file and reporting success)
- handle dismiss before the kitty guard so it works without kitty installed
- require both managed-block markers before the uninstall range-delete to
  prevent deleting to EOF on a malformed block
2026-06-16 09:58:19 -04:00
rootiest 4f266f691b feat(kitty): add kitty-logging install/uninstall/status/dismiss command 2026-06-16 02:12:47 -04:00
rootiest ca0a35e8c7 feat(kitty): add kitty-logging resolver/inspection helpers 2026-06-16 02:09:52 -04:00
rootiest 5b74fbe427 feat(c5): add zellij exit-capture logging and shared prune helper
Zellij has no live-stream facility like tmux pipe-pane, so capture is a
one-shot 'zellij action dump-screen --full' run from a fish_exit handler
(conf.d/zellij-logging.fish -> functions/_zellij_dump_log.fish). The C5
guard is checked inside the helper at exit time, so toggling logging
needs no sync_logging coordination — there is no persistent stream.

Extract pruning into functions/_prune_terminal_logs.fish, shared by both
the tmux and zellij helpers. This also fixes a latent bug in the tmux
helper: globbing tmux_*.log directly errored with 'No matches for
wildcard' on the first log in an empty dir. The shared helper globs via
'set' (tolerates no-match) and uses command ls/rm to bypass the eza and
trash C1 shadows.
2026-06-16 01:16:22 -04:00
rootiest b998cc652e feat(c5): prune old tmux logs and share pipe-pane helper
Extract the tmux pipe-pane setup into functions/_tmux_pipe_log.fish,
called by both conf.d/tmux-logging.fish (startup) and
__fish_config_sync_logging (C5 re-enable). The helper prunes the oldest
tmux_*.log files by mtime to stay within SCROLLBACK_HISTORY_MAX_FILES,
matching the paru/yay wrappers.

Uses 'command ls' to bypass the eza ls shadow, which injects OSC-8
hyperlink escapes into paths and corrupted the filenames passed to rm.
2026-06-16 01:03:54 -04:00
rootiest 2e1750b5a4 fix(c5): use fish-valid variable concatenation in tmux log filename
Fish does not support bash-style ${var} brace syntax. Build the
log file path in a dedicated variable using quote-splicing instead.
2026-06-16 00:55:53 -04:00
rootiest 764f2253f6 fix(c5): update sync_logging function description to mention tmux 2026-06-16 00:53:44 -04:00
rootiest 2e6abec499 feat(c5): add tmux pipe-pane session logging
Starts tmux pipe-pane capture for the current pane whenever fish
launches inside a tmux session. Each shell gets a timestamped log
in SCROLLBACK_HISTORY_DIR. Toggling __fish_config_op_logging stops
or restarts the pipe in all open fish shells via the existing
--on-variable event handlers.
2026-06-16 00:52:59 -04:00
rootiest a5966fd982 chore(agents-init): fix formatting and alignment 2026-06-13 00:24:18 -04:00
rootiest 976f46757c fix(agents-init): quiet only on change, add -v/--verbose flag
- quiet mode now outputs one summary line only when something actually changed;
  idempotent re-runs produce no output
- add -v/--verbose flag as an explicit alias for the default verbose behavior
- gitignore helper output captured to detect changes without printing in quiet mode
- drop eager "Initializing…" header in favour of end-of-run conditional summary
2026-06-13 00:19:11 -04:00
rootiest 2a7cb0f5cb feat(agents-init): add -a/--agents and -p/--plugins short flags 2026-06-13 00:05:31 -04:00
rootiest 8f845f7cf2 feat(agents-init): add --quiet and --silent flags; wrappers use --quiet 2026-06-13 00:03:11 -04:00
rootiest 69384f6427 fix(agents-init): use command cp -rn to bypass interactive wrapper and skip existing files 2026-06-12 23:51:30 -04:00
rootiest 9f9248deb1 fix(agents-init): fix gitignore duplicate entries, add block comment style
- Strip leading / from pattern before git check-ignore so root-anchored
  patterns like /AGENTS.md are checked as repo-relative paths (AGENTS.md)
  and correctly match existing rules — fixes duplicates on every run
- Rework helper to accept multiple patterns and write them as a single
  labeled block with project-style header/footer comment rather than
  appending bare patterns one at a time
- Move gitignore calls out of per-plug loop in --plugins mode so all
  three docs/ patterns are checked and written in one block
- Remove 5 duplicate bare entries left in .gitignore by the broken runs
2026-06-12 23:30:12 -04:00
rootiest 3a054021cf fix(agents-init): migrate plugin dirs, smarter CLAUDE.md handling, wrappers run full init
- Move plugin dir creation into --plugins mode (not 'Always') so --agents
  alone no longer creates empty AGENTS/plugins/ dirs
- Wrappers (claude, agy) now call plain agents-init (both modes) so plugin
  dirs in docs/ are migrated on the first AI launch, not just --agents
- Rewrite --agents CLAUDE.md logic: detect which root files are real vs
  symlinks and handle all four cases (both/agents-only/claude-only/neither)
  without ever losing content
- AGENTS/CLAUDE.md is now its own file in AGENTS/ (real file when both
  existed, symlink → AGENTS.md for single-source cases)
- Root CLAUDE.md now points to AGENTS/CLAUDE.md instead of AGENTS/AGENTS.md;
  readlink checks auto-fix existing symlinks with the wrong target
- New empty setups get AGENTS/AGENTS.md pre-populated with the agent
  directive warning editors not to write through the root symlinks
2026-06-12 23:05:40 -04:00
rootiest d68bedef95 chore: remove antigravity wrapper (filtered error no longer exists, use agy directly) 2026-06-12 22:26:56 -04:00
rootiest e96f874469 feat(agy): wrap agy with agents-init --agents, same as claude wrapper 2026-06-12 22:25:47 -04:00
rootiest 178214c812 docs: add SYNOPSIS/DESCRIPTION doc blocks to session hook scripts and index entries 2026-06-12 22:13:31 -04:00
rootiest 45cba3a15b fix(agents-init): address final review issues (CLAUDE.md safety, rm-rf guard, gitignore anchoring, worktree detection) 2026-06-12 22:09:44 -04:00
rootiest 0167370823 refactor(claude): delegate symlink logic to agents-init --agents 2026-06-12 22:01:50 -04:00
rootiest 8d0f425b10 feat(agents-init): add auto-commit step for AGENTS/ sub-repo 2026-06-12 21:59:02 -04:00
rootiest a483c30c05 fix(agents-init): use fish-idiomatic command substitution in --plugins mode 2026-06-12 21:55:05 -04:00
rootiest 3befc07887 feat(agents-init): add --plugins mode (docs/ move + symlinks + gitignore) 2026-06-12 21:53:32 -04:00
rootiest 2a9a7ed2ff fix(agents-init): add error checks and CLAUDE.md move to --agents mode 2026-06-12 21:51:05 -04:00
rootiest d1949953df feat(agents-init): add --agents mode (AGENTS.md move + symlinks + gitignore) 2026-06-12 21:48:25 -04:00
rootiest 7463d894f2 fix(agents-init): address code quality issues in skeleton 2026-06-12 21:46:59 -04:00
rootiest 1e1c2003f3 feat(agents-init): scaffold function with argparse, help, and sub-repo init 2026-06-12 21:42:58 -04:00
rootiest e6de825fb1 fix(agents-init): move argv assignments after guard in gitignore helper 2026-06-12 21:41:14 -04:00
rootiest b6ed77d8f9 fix(agents-init): add write-error check and arg validation to gitignore helper 2026-06-12 21:40:27 -04:00
rootiest 522fd03c12 feat(agents-init): add gitignore helper function 2026-06-12 21:38:26 -04:00
rootiest 93fc5e0517 feat(config-toggle): adaptive width, centering, and resize handling
Panel now selects from four width tiers based on $COLUMNS (with a 6-col
buffer per side before stepping up): 52-wide (default), 70, 74, or 78.
Each tier carries richer category descriptions sized to fit the layout.
The box is horizontally centered on every draw via a left-padding prefix.

Key reader switches from stty min 1 to min 0 / time 3, giving a 0.3 s
poll interval so COLUMNS changes are detected without a keypress. The
erase formula is now wrap-aware: prev_max_line_width / COLUMNS gives the
wrap factor, ensuring old wider panels are fully cleared after narrowing.
Idle timeout ticks that detect no resize are skipped entirely.
2026-06-12 19:17:49 -04:00
rootiest f76a45e273 feat: add claude wrapper that auto-links AGENTS.md as CLAUDE.md
New functions/claude.fish wraps the claude CLI. Before launch it checks the
current directory and the git project root; when CLAUDE.md is absent but
AGENTS.md is present, it creates a relative symlink CLAUDE.md -> AGENTS.md so
Claude Code picks up shared agent instructions without duplicating the file.
Arguments are forwarded verbatim.

Implemented as a C1 command shadow: when __fish_config_op_aliases (or the
master __fish_config_opinionated) is disabled, the call passes through to the
bare claude binary unchanged. Link-creation notices print to stderr in green.

Documents the new shadow in docs/fish-config.md (section 5.12 AI tools, C1
component reference table, and C1 summary list) and adds a claude-cli anchor
to docs/fish-config.index.
2026-06-12 17:44:40 -04:00
rootiest 4210f3b445 fix: suppress fish shadow warning corrupting config-toggle redraw
When a category variable is set explicitly in both universal and session
scope, interactive fish prints a one-line stderr warning ("successfully set
universal 'X'; but a global by that name shadows it") on each `set -U`/`set
-g`. That stray line landed between the apply and the in-place panel redraw,
pushing the cursor down one row so the `\e[14A` cursor-up no longer reached
the top border — leaving it behind to stack on every toggle and persist
after exit.

Suppress stderr on the six set commands in __config_toggle_apply. The
warning is expected noise here since config-toggle edits both scopes
independently. The warning only fires in a real interactive TTY (not under
`fish -ic`), which is why it was easy to miss when testing.
2026-06-12 17:40:18 -04:00
rootiest 4f8c45c4ef fix: restore docker context behind starship+C3 guard, use long date format in right prompt 2026-06-12 00:51:55 -04:00
rootiest 7527f01a2b fix: use jobs -c in background loop, reset color after loop, clean up right_prompt 2026-06-12 00:47:27 -04:00
rootiest b5513ccbde fix: overhaul fish_right_prompt — exit code, dim time, remove docker dep 2026-06-12 00:41:53 -04:00
rootiest 4c77f3b0af fix: add operator vi-mode case and # prefix to hex palette in fish_prompt 2026-06-12 00:40:51 -04:00
rootiest eb828a09d5 feat: add catppuccin nim-style fallback fish_prompt 2026-06-12 00:38:22 -04:00
rootiest ab284641a5 fix: add RETURNS block and remove blank line in fish_mode_prompt docstring 2026-06-12 00:36:30 -04:00
rootiest fefcb9034b feat: add empty fish_mode_prompt stub to suppress vi-mode prefix 2026-06-12 00:35:26 -04:00
rootiest 36a303f7d4 fix(deps): demote cargo/starship to rec, remove fisher from catalog
Required tier is now fish, fzf, and zoxide only — the tools the config
meaningfully can't function without. Everything else degrades gracefully.

- cargo: only used by fish-deps to install Rust tools or build fish from
  source; all paths are already gated on type -q cargo
- starship: type -q guard in conf.d/starship.fish; shell falls back to
  fish's built-in prompt without it
- fisher: auto-bootstrapped by first_run.fish; no need for users or
  fish-deps to manage it. Remove from catalog and clean up the now-dead
  fisher-bootstrap/special-fisher installer cases.

Catalog arrays verified aligned at 26 entries each.
2026-06-11 23:50:37 -04:00
rootiest 5c224694ec fix(deps): demote direnv to recommended
direnv integration is fully guarded with type -q direnv in config.fish.
The auto-venv script checks $DIRENV_DIR (set at runtime), not the binary.
Without direnv installed the hook simply never loads and venv activation
fires normally. No functionality breaks.
2026-06-11 23:36:50 -04:00
rootiest a3b60718de fix(deps): demote uv to recommended, remove dead pipx installer code
uv is only used in the fish-deps fish-from-source build path
(uv run --no-managed-python cargo install --path .) and is not required
by the config at runtime. All consumers degrade gracefully without it.

pipx appeared in the installer's method-building and execution switch
blocks but no catalog entry ever sets special=pipx, making both branches
permanently unreachable dead code. The docs listed pipx as install
priority #6 which was equally misleading.

- _fish_deps_catalog: change uv tier from req → rec
- _fish_deps_install: remove case pipx method-builder and
  special-pipx / special-pip execution cases
- docs/fish-config.md: move uv from Required to Recommended catalog
  entry with accurate description; drop pipx from install priority
  list and tier summary
2026-06-11 23:28:33 -04:00
rootiest 681a48f3c5 feat(deps): catalog python3 as a recommended dependency
python3 is used unguarded by the AI session helpers and (guarded) by the
paru/yay log cleaner, but was absent from the dependency catalog and docs.
uv does not provide python3 on PATH, and Arch's base omits it, so it is
tracked separately rather than assumed via uv.

- Add python3 (recommended tier, pm: python) to _fish_deps_catalog.fish
- Guard python3 calls in save_claude_session/save_antigravity_session with
  `type -q python3`, emitting valid empty JSON when absent (Convention §6)
- Document python3 in docs/fish-config.md (§5.6 tiers + catalog entry)
2026-06-11 23:15:17 -04:00
rootiest 764a9d35e5 feat(config-toggle): right-align ON badge to mirror value direction
The badge now positions each state by where it sits on the scale: OFF
left-aligned, DEFAULT centered, ON right-aligned. This makes the
OFF ← DEFAULT → ON ordering visible at a glance and reinforces the
direction the ←→/h l keys move.
2026-06-11 03:16:33 -04:00
rootiest cfd4749e72 feat(config-toggle): drop Space, add vim h/l for value changes
Directional arrows fully cover value changes, so the Space cycle is
removed. Add h/l as vim-style aliases for ←/→ (matching the existing
j/k for up/down), keeping the whole keymap hjkl-consistent. Update the
in-panel hint, help text, docstrings, and offline docs accordingly.
2026-06-11 03:10:50 -04:00
rootiest bddb068ec0 feat(config-toggle): add Left/Right arrows for directional value changes
Left/Right now adjust the highlighted value one step along the
OFF ← DEFAULT → ON scale, clamped at the ends (no wrap), complementing
Space which cycles through all states and wraps. Right steps toward ON,
Left toward OFF.

Extract the set/erase side-effect into __config_toggle_apply so Space,
Left, and Right share one implementation of the scope-aware
set -U/-g/-Ue/-eg logic. Update the in-panel keybind hint (now
width-padded via string pad so the border stays aligned) and the help
text and offline docs to cover the new keys.
2026-06-11 03:07:17 -04:00
rootiest 608b0227cb fix(config-toggle): read keys via raw tty, fixing arrows/Tab/redraw/prompt
fish's `read` invokes its interactive line editor on a TTY, which (1)
prints a `read> ` prompt below the panel, (2) intercepts Tab and arrow
keys for its own line editing so they never reach the switch, and (3)
shifts the cursor down a line, throwing off the `\e[14A` redraw so top
borders stacked on every keypress. Plain keys (j/k/q/space) passed
through, masking the problem.

Add __config_toggle_read_key: puts the terminal in raw, no-echo mode
(`stty raw -echo min 1 time 1`), reads one keypress from /dev/tty, and
returns a normalized token (up/down/left/right/tab/space/escape/quit or
the literal char) by decoding the bytes via od. Arrow keys and Tab now
work, there is no stray prompt, and the redraw stays aligned. Ctrl-C in
raw mode arrives as byte 3 and maps to quit; bare Esc exits after the
0.1s inter-byte timer.

Rewrite the event loop to consume these tokens and restore Esc to the
help text.
2026-06-11 03:03:32 -04:00
rootiest 5a018fe975 fix(config-toggle): use valid -n read flag, stopping the busy redraw loop
The event loop used `read -k 1`, but `-k` is not a valid fish read option
(it errors with "unknown option", status 2). read therefore returned
instantly every iteration without consuming a keypress, so the loop
redrew the panel as fast as the terminal could render and ignored all
input. The nchars flag is `-n`, not `-k`.

Switch to `read -s -n 1` (one char, silent so keystrokes don't garble the
panel) and add `or break` so a read failure (EOF / non-tty stdin) exits
cleanly instead of spinning. Applies to the primary read and both escape
sequence continuation reads.
2026-06-11 02:56:12 -04:00