Commit Graph

115 Commits

Author SHA1 Message Date
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
rootiest cc14f7fb3d fix(config-toggle): replace read -k 3 with read -k 1 + ESC sequence detection
fish's read -k N waits for exactly N bytes; single-char keys ('q', 'j',
Space, Tab) were blocking indefinitely waiting for 2 more bytes, causing
the input loop to appear unresponsive. Random 3-key bundles were then
processed as unrecognised input, triggering infinite redraws.

Switch to read -k 1 (one raw byte per call). Arrow keys still work: the
terminal sends ESC+[+A/B as a burst, so after reading ESC the two
continuation bytes are already in the TTY buffer and the follow-up reads
return immediately. Bare ESC now passes the next keypress through as the
effective key rather than exiting (q/Q remain the exit keys).
2026-06-11 02:51:01 -04:00
rootiest bff084db07 fix(config-toggle): exit on Ctrl-C via flag variable, add README tip 2026-06-11 01:29:28 -04:00
rootiest 43fd36f5ea feat(config-toggle): add Space cycling with immediate apply 2026-06-11 01:18:09 -04:00
rootiest 9a820fc3e6 fix(config-toggle): use read -k 3 for ESC sequences, clear INT trap on exit
Replace two-read-k-1 ESC handling with a single read -k 3 so that a bare
ESC returns immediately instead of blocking the shell indefinitely waiting
for a second byte.  Add trap - INT in the cleanup block so the signal
handler does not leak into the global session after config-toggle exits.
2026-06-11 01:16:41 -04:00
rootiest d20f7f8d7b feat(config-toggle): add event loop with navigation and scope switching 2026-06-11 01:11:04 -04:00
rootiest a4f6ee26cb feat(config-toggle): add function skeleton and help flag 2026-06-11 01:07:15 -04:00
rootiest c9174f9d4a feat(config-toggle): add panel renderer helper 2026-06-11 01:01:19 -04:00
rootiest c372c96dd7 feat(config-toggle): add scope-specific variable reader helper 2026-06-11 00:52:11 -04:00
rootiest c04c1a4bc2 docs(guards): fold no-arg edge case into RETURNS status-1 line 2026-06-10 22:59:49 -04:00
rootiest 4c989a45c1 refactor(guards): remove what-comments; document no-arg edge case in RETURNS 2026-06-10 22:59:11 -04:00
rootiest cccef17031 feat(guards): category variable overrides master in __fish_config_op_enabled 2026-06-10 22:57:01 -04:00
rootiest 5394a6d494 docs(greeting): add C5 and C6 to __fish_config_op_enabled ARGUMENTS docstring 2026-06-10 22:30:26 -04:00
rootiest 7fcf268fc7 fix(logging): suppress Kitty watcher capture when C5 logging is disabled
When smart_exit skips fish-side capture due to the C5 guard, it now sets
logged_by_shell=true on the Kitty window before calling builtin exit. This
prevents watcher.py's on_close handler from capturing the scrollback even
if the sentinel file is absent, providing a second layer of protection.

Also restructures the capture block to be flat (no wrapper if-true) after
the early-exit guard.
2026-06-10 21:59:52 -04:00
rootiest 76349ad94b fix(logging): register C5 event handlers in conf.d for reliable startup
--on-variable handlers in functions/ are only autoloaded on explicit call,
so they never fire when a universal variable changes. Moving the definitions
to conf.d/logging-events.fish ensures they are registered at shell init.

Also adds a startup __fish_config_sync_logging call so pre-set variable
values (e.g. set before this shell was opened) take effect immediately
without requiring a re-set.
2026-06-10 21:54:56 -04:00
rootiest be3dd7494e feat(logging): gate scrollback capture in smart_exit under C5 guard 2026-06-10 21:29:52 -04:00
rootiest 0382d6ab9c feat(logging): add C5 --on-variable event handlers for real-time sync 2026-06-10 21:28:13 -04:00
rootiest f17229d0b8 feat(logging): add __fish_config_sync_logging shared C5 state sync 2026-06-10 21:26:40 -04:00
rootiest dc97892a29 feat(guards): add in-function opinionated guards and CachyOS cleanup
C1 shadows (rm, cat, ls, less, du, bash, top, ping, ssh, rg, mkdir,
help) fall back to the bare command when __fish_config_op_aliases is
falsy; rm falls back to exact 'command rm' with no wrapper. C2 gates
the auto-venv PWD hook. C3 gates smart_exit (composing with Task #4
logging), fish_right_prompt, and all six expand_bang_*/expand_typo_sub
functions atomically with the bang-bang system. C4 integration commands
(spwin, tab, split, hist, logs, upgrade) refuse with a colored stderr
error when disabled. config.fish now also strips the CachyOS distro
config's own bang-bang bindings, history override, and alias opinions
per category, restoring fish stock functions where they exist.
2026-06-10 11:34:56 -04:00
rootiest ce84db593c feat(guards): add opinionated component guards to config.fish and conf.d
Adds __fish_config_op_enabled helper (master __fish_config_opinionated
evaluated first via __fish_variable_check, then the category variable)
and gates C1-C4 components: CachyOS surgical override, PAGER/MANPAGER,
CDPATH, Vi mode, exit override, bang-bang bindings, history/cp/mv/wget/
grep aliases, cd->z alias, Fisher bootstrap and theme apply, paru/yay
wrapper generation, WakaTime hook, custom key chords, puffer, autopair,
starship prompt, Catppuccin colors, FZF_DEFAULT_OPTS, done notifications,
and Kitty/WezTerm window-management abbreviations.
2026-06-10 11:28:43 -04:00
rootiest cdf850f2e7 fix(config-help): quote +/pattern in MANPAGER to prevent word-splitting on spaces 2026-06-08 23:18:31 -04:00
rootiest c5d6e35afc fix(config-help): add -- separator before -+ regex pattern in string replace 2026-06-08 23:16:44 -04:00
rootiest 831c7beb4d feat(config-help): add section linking for HTML and man page
Generate documentation / build-docs (push) Successful in 30s
Offline docs drift reminder / remind (push) Successful in 10s
- Section keyword is now extracted early and shared across all three
  output modes (pager, HTML, man) rather than duplicated per branch
- --html with a section keyword resolves the heading to a pandoc anchor
  ID and looks it up in docs/html/sitemap.json; handles both sub-section
  fragment paths and top-level sections that are their own page
- --man with a section keyword overrides MANPAGER to `less +/pattern`
  so the page opens at the nearest heading match
- --help output updated to show [section] in USAGE and section+flag
  examples (help config keybindings --html, help config pkg --man)
- docs/fish-config.md §5.14 synopsis, flags, and examples updated
- docs/fish-config.md §11 "Viewing" sections updated for both HTML and
  man page to document the section+flag invocation
- README table updated with section+html and section+man rows
2026-06-08 23:15:17 -04:00
rootiest 79f8445e25 docs(help): prefer help config syntax; add NOTES to config-help doc block
Generate documentation / build-docs (push) Successful in 35s
Offline docs drift reminder / remind (push) Successful in 10s
- help.fish: expand SYNOPSIS/DESCRIPTION to document -w/--html, -m/--man,
  -h/--help flags; note flags are only intercepted when 'config' is argv[1]
- config-help.fish: add # NOTES section explaining help config as the
  preferred invocation; update --help banner to show both names; update
  --help USAGE/EXAMPLES output to use `help config` syntax throughout
- docs/fish-config.md: update §5.14 synopsis/examples and "Viewing" sections
  to use `help config` as primary form; inline note for direct config-help use
- README.md: update docs table to show `help config --html` / `--man`
2026-06-08 23:04:39 -04:00
rootiest 8911146d3f fix(sponge): guard set -q value[1] before string length to handle unset vars 2026-06-08 22:26:00 -04:00
rootiest 1637dc3122 fix(sponge): use $$var[1] to avoid test arg-count error on array vars 2026-06-08 22:24:31 -04:00
rootiest bceff8f4ec feat(sponge): add three-layer privacy filtering for shell history
conf.d/sponge_privacy.fish registers patterns and filters that prevent
credentials from reaching fish history:

  Layer 1 (static regex, universal): auth flags, env assignments,
  credential-bearing URLs, Authorization headers, sshpass, docker
  login, openssl -passin/-passout

  Layer 2 (dynamic values, session globals): on the first prompt, after
  secrets.fish has loaded, reads the literal values of all exported
  credential-named vars (TOKEN, PASSWORD, SECRET, etc.), escapes them
  for regex, and merges them with the static patterns as a session
  global — auto-refreshes on login so rotated tokens are never stale

  Layer 3 (per-command filter, sponge_filter_secrets): catches
  credentials in variables exported mid-session (e.g. project .env)

Also exempts functions/sponge_filter_secrets.fish from the sponge_*
gitignore glob so our custom filter is committed alongside the config.
2026-06-08 22:23:29 -04:00
rootiest de07040c16 feat(config-help): add --html and --man flags; add config-update function
config-help gains two new flags:
- --html / -w: opens docs/html/index.html in the default browser using
  smart browser detection (xdg-mime https scheme handler → known binaries
  → xdg-open fallback) to avoid MIME-type mismatches with non-browser apps
- --man / -m: opens the compiled docs/fish-config.1 man page via man -l

config-update is a new function that pulls the latest fish config from the
hard-coded upstream URL without requiring a configured git remote. Suppresses
git output and reports status with colored messages. Supports --dry-run and
--force flags.

README updated to document all new commands.
2026-06-08 15:29:57 -04:00
rootiest 569d17a342 feat(help): integrate config-help into fish's help command
Rename config_help → config-help and add a help wrapper that
intercepts 'help config [section]', forwarding sub-topics to
config-help. Update README and docs to use 'help config' as the
preferred interface so offline docs feel like a natural extension
of fish's built-in help system.
2026-06-06 22:31:24 -04:00
rootiest ba92267a80 feat(config_help): colorize --help output
Section headers in bold blue, argument/flag names in yellow, command
examples in green, navigation keys in cyan, fallback chain numbers
dimmed. All reset to normal after each colored span.
2026-06-06 04:23:58 -04:00
rootiest cb4d74423a feat(config_help): add --help flag and persistent nav hint header
- config_help --help / -h prints full usage, section keyword examples,
  ov navigation key reference, and the pager fallback chain.
- Prepend a dim nav hint line to the ov input stream and pin it with
  --header 1 so "Space=next section  ^=prev  Alt+u=sections  /=search
  q=quit" is always visible at the top of the screen.
2026-06-06 04:16:13 -04:00
rootiest 368b714a98 fix(config_help): reliable section lookup and jump via index + tail-slice
- Add docs/fish-config.index mapping 100+ keyword aliases to exact heading
  text; config_help looks up here first, falls back to normalized heading
  scan (strips non-alphanumeric, lowercases both sides) for unknown terms.
- Resolve line numbers at runtime with grep -F so the index never goes
  stale from doc edits — only heading renames require an update.
- Fix section jump: --section-header pins delimiter lines as sticky headers
  removing them from ov pattern-search scope. Replace --pattern with
  tail -n +$start_line piped before ov; the target section is the first
  line so no search is needed and forward section nav still works.
- Fix empty sections sidebar: ov matches --section-delimiter against
  logical (ANSI-stripped) text, so "^#" is correct for bat-colored output;
  the previous ANSI escape-sequence regex never matched anything.
2026-06-06 04:09:12 -04:00
rootiest 02c27c6907 feat(docs): add offline documentation, config_help viewer, and CI pipelines
- docs/fish-config.md: curated terminal-optimized manual covering all
  public functions, keybindings, abbreviations, configuration variables,
  dependency catalog, and customization guide. Written for ov/bat/less
  readability rather than browser rendering — no callouts, no hyperlinks.
  Pandoc-compatible YAML front matter for man page compilation.

- functions/config_help.fish: viewer function with fallback chain
  ov -> bat -> man -l -> less -> cat. Accepts an optional section
  keyword to jump directly to the first matching heading.

- .gitea/workflows/man-page.yml: compiles docs/fish-config.md to
  docs/fish-config.1 via pandoc on every push to main that touches the
  source doc, then commits the result automatically.

- .gitea/workflows/docs-drift.yml: opens a reminder issue whenever
  README.md changes without a corresponding docs/fish-config.md update
  in the same push.

- README.md: documents config_help and the offline manual.
- AGENTS.md: adds Convention 10 requiring offline doc to be updated
  alongside any function, keybinding, or config change.
2026-06-06 03:14:36 -04:00
rootiest 014a8c3515 remove(functions): drop claude.fish wrapper
Remote-control is now enabled directly in the Claude Code config,
making the shell wrapper redundant.
2026-06-06 02:41:26 -04:00