From c3a2e3546570b4cb7756ec2ca2199576027e3b6d Mon Sep 17 00:00:00 2001 From: Rootiest Date: Tue, 18 Aug 2026 02:22:31 -0400 Subject: [PATCH] refactor(config): migrate C5 logging call sites to self-identifying guard --- conf.d/__fish_config_op_registry.fish | 10 ++++++++++ conf.d/kitty-watcher-reminder.fish | 6 +++++- conf.d/tmux-logging.fish | 6 +++++- functions/__fish_config_sync_logging.fish | 5 ++++- functions/_zellij_dump_log.fish | 5 ++++- functions/kitty-logging.fish | 7 +++++-- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/conf.d/__fish_config_op_registry.fish b/conf.d/__fish_config_op_registry.fish index b9cd5d7..96bda28 100644 --- a/conf.d/__fish_config_op_registry.fish +++ b/conf.d/__fish_config_op_registry.fish @@ -8,7 +8,9 @@ set -g __fish_config_op_registry_keys \ __auto_source_fallback_venv: \ + __fish_config_sync_logging: \ __fish_user_dots_link: \ + _zellij_dump_log: \ agy: \ auto-pull: \ autopair: \ @@ -23,6 +25,8 @@ set -g __fish_config_op_registry_keys \ help: \ hist: \ key_bindings: \ + kitty-logging: \ + kitty-watcher-reminder: \ less: \ logs: \ ls: \ @@ -38,6 +42,7 @@ set -g __fish_config_op_registry_keys \ starship: \ tab: \ theme: \ + tmux-logging: \ top: \ upgrade: \ yt-dlp: \ @@ -45,7 +50,9 @@ set -g __fish_config_op_registry_keys \ set -g __fish_config_op_registry_values \ "autoexec/venv" \ + "logging/terminal-capture" \ "autoexec/sync" \ + "logging/multiplexer-capture" \ "aliases/dev-tools" \ "autoexec/sync autoexec/sync" \ "overrides/key-bindings" \ @@ -60,6 +67,8 @@ set -g __fish_config_op_registry_values \ "aliases/shell-tools" \ "integrations/history-logs" \ "overrides/key-bindings" \ + "logging/terminal-capture" \ + "logging/terminal-capture" \ "aliases/shell-tools" \ "integrations/history-logs" \ "aliases/filesystem" \ @@ -75,6 +84,7 @@ set -g __fish_config_op_registry_values \ "overrides/prompt" \ "integrations/window-mgmt" \ "overrides/prompt" \ + "logging/multiplexer-capture" \ "aliases/monitor" \ "integrations/pkg-upgrade" \ "aliases/network" \ diff --git a/conf.d/kitty-watcher-reminder.fish b/conf.d/kitty-watcher-reminder.fish index ad8e37c..d8bcb71 100644 --- a/conf.d/kitty-watcher-reminder.fish +++ b/conf.d/kitty-watcher-reminder.fish @@ -1,5 +1,9 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later + +# COMPONENT +# logging/terminal-capture + # # C5 — Logging & Capture: a non-blocking, per-session reminder shown inside Kitty # when the fish-config scrollback watcher is not yet set up. It never blocks the @@ -10,7 +14,7 @@ status is-interactive; or exit type -q kitty; or exit set -q KITTY_WINDOW_ID; or exit -__fish_config_op_enabled __fish_config_op_logging; or exit +__fish_config_op_enabled (status basename); or exit __fish_variable_check __fish_config_kitty_watcher_dismissed; and exit __kitty_logging_has_watcher; and exit diff --git a/conf.d/tmux-logging.fish b/conf.d/tmux-logging.fish index cc416b4..c1857fc 100644 --- a/conf.d/tmux-logging.fish +++ b/conf.d/tmux-logging.fish @@ -1,12 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later + +# COMPONENT +# logging/multiplexer-capture + # # C5 — Logging & Capture: starts a pipe-pane log for the current tmux pane # when fish launches inside a tmux session. Each fish shell gets its own # timestamped log file in SCROLLBACK_HISTORY_DIR (default: ~/.terminal_history). # Naming: tmux_-w-p_YYYY-MM-DD_HH-MM-SS.log -__fish_config_op_enabled __fish_config_op_logging; or exit +__fish_config_op_enabled (status basename); or exit status is-interactive; or exit type -q tmux; or exit set -q TMUX; or exit diff --git a/functions/__fish_config_sync_logging.fish b/functions/__fish_config_sync_logging.fish index 431a793..2d61e86 100644 --- a/functions/__fish_config_sync_logging.fish +++ b/functions/__fish_config_sync_logging.fish @@ -1,6 +1,9 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# COMPONENT +# logging/terminal-capture +# # SYNOPSIS # __fish_config_sync_logging # @@ -29,7 +32,7 @@ function __fish_config_sync_logging --description 'Sync C5 logging state: sentin set -l yay_wrapper "$HOME/.local/bin/yay" set -l wrapper_version 1 - if __fish_config_op_enabled __fish_config_op_logging + if __fish_config_op_enabled (status current-function) # Logging enabled: remove sentinel and regenerate wrappers if binaries exist rm -f $sentinel diff --git a/functions/_zellij_dump_log.fish b/functions/_zellij_dump_log.fish index ab036c7..46ab9bb 100644 --- a/functions/_zellij_dump_log.fish +++ b/functions/_zellij_dump_log.fish @@ -1,6 +1,9 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# COMPONENT +# logging/multiplexer-capture +# # SYNOPSIS # _zellij_dump_log # @@ -23,7 +26,7 @@ # EXAMPLE # _zellij_dump_log function _zellij_dump_log --description 'Dump the current Zellij pane scrollback to a log file, with pruning' - __fish_config_op_enabled __fish_config_op_logging; or return 0 + __fish_config_op_enabled (status current-function); or return 0 set -q ZELLIJ; or return 0 type -q zellij; or return 0 diff --git a/functions/kitty-logging.fish b/functions/kitty-logging.fish index 3c56241..c9c1151 100644 --- a/functions/kitty-logging.fish +++ b/functions/kitty-logging.fish @@ -4,6 +4,9 @@ # CATEGORY # 14-miscellaneous # +# COMPONENT +# logging/terminal-capture +# # SYNOPSIS # kitty-logging [install | uninstall | status | dismiss] [-h] # @@ -97,7 +100,7 @@ function kitty-logging --description 'Install/manage the fish-config Kitty scrol else echo " Watcher file: $c_warn""not installed$c_reset" end - if __fish_config_op_enabled __fish_config_op_logging + if __fish_config_op_enabled (status current-function) echo " C5 logging: $c_ok""enabled$c_reset" else echo " C5 logging: $c_warn""disabled$c_reset (capture is currently inert)" @@ -143,7 +146,7 @@ function kitty-logging --description 'Install/manage the fish-config Kitty scrol end echo "$c_ok""→ Installed.$c_reset Watcher wired into $conf" echo " $c_dim""Restart Kitty (new windows) for it to take effect.$c_reset" - if not __fish_config_op_enabled __fish_config_op_logging + if not __fish_config_op_enabled (status current-function) echo " $c_warn""Note: C5 logging is disabled, so capture is currently inert.$c_reset" end return 0