Start and stop tmux-originated ingestion for the addon.
Installing hooks is OPT-IN and off by default. set-hook -g is a persistent,
server-wide change to the operator's tmux, and an addon that rewrites it on
every init would be editing an environment it does not own. The listener
itself is inert (a socket nobody writes to), so it starts by default and the
operator turns on the half that touches their server.
Start and stop tmux-originated ingestion for the addon. Installing hooks is OPT-IN and off by default. `set-hook -g` is a persistent, server-wide change to the operator's tmux, and an addon that rewrites it on every init would be editing an environment it does not own. The listener itself is inert (a socket nobody writes to), so it starts by default and the operator turns on the half that touches their server.
(config->observe config)The ingestion config carried by addon CONFIG, with defaults applied.
The ingestion config carried by addon CONFIG, with defaults applied.
(default-client-cmd)The command tmux runs per hook firing.
Prefers the compiled client named by $HIVE_TMUX_HOOK_BIN, else the one
installed at ~/.local/bin/hive-tmux-hook, and falls back to running the
source through cljw.
Compiling buys no speed (both start in ~17ms), so the reason to prefer the binary is that it is self-contained: tmux runs a hook with a cwd the addon does not own, and the interpreted form needs a relative classpath, the source tree, and prints a deps.edn note on every firing.
The command tmux runs per hook firing. Prefers the compiled client named by `$HIVE_TMUX_HOOK_BIN`, else the one installed at `~/.local/bin/hive-tmux-hook`, and falls back to running the source through cljw. Compiling buys no speed (both start in ~17ms), so the reason to prefer the binary is that it is self-contained: tmux runs a hook with a cwd the addon does not own, and the interpreted form needs a relative classpath, the source tree, and prints a deps.edn note on every firing.
(default-socket-path)Where the listener binds when the operator names no path.
Prefers $XDG_RUNTIME_DIR, which is per-user and cleared on logout, so a
stale socket cannot outlive the session that made it. The path must stay
under the OS 108-byte sun_path cap, which a runtime dir comfortably does.
Where the listener binds when the operator names no path. Prefers `$XDG_RUNTIME_DIR`, which is per-user and cleared on logout, so a stale socket cannot outlive the session that made it. The path must stay under the OS 108-byte `sun_path` cap, which a runtime dir comfortably does.
(enabled? config)Whether ingestion runs at all. Default true: the listener is inert.
Whether ingestion runs at all. Default true: the listener is inert.
(install-hooks? config)Whether to write set-hook -g into the operator's tmux server.
Default FALSE. This is the only part of ingestion that modifies something outside hive, so it is never on by accident.
Whether to write `set-hook -g` into the operator's tmux server. Default FALSE. This is the only part of ingestion that modifies something outside hive, so it is never on by accident.
(start! config)(start! config run!)Start ingestion for addon CONFIG. Returns a handle for stop!, or nil when
disabled. Never throws: ingestion is an enhancement, and a failure to start
it must not fail addon initialization.
Start ingestion for addon CONFIG. Returns a handle for `stop!`, or nil when disabled. Never throws: ingestion is an enhancement, and a failure to start it must not fail addon initialization.
(stop! handle)(stop! {:keys [listener observe hooks-installed?]} run!)Stop ingestion, removing any hooks this addon installed.
Hooks are removed only when start! installed them: unsetting a hook the
operator wrote by hand would be destroying their configuration.
Stop ingestion, removing any hooks this addon installed. Hooks are removed only when `start!` installed them: unsetting a hook the operator wrote by hand would be destroying their configuration.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |