feat(overlay): full command display, smart regex proposal, tmux notification passthrough#24
Merged
nnemirovsky merged 5 commits intomainfrom Apr 18, 2026
Merged
Conversation
…ication passthrough - overlay-dialog: wrap long commands at terminal width instead of truncating with "..." - propose-rule: when compound command has uncovered segments (via new PASSTHRU_OVERLAY_UNALLOWED_SEGMENTS env var), target the first uncovered segment's first word instead of the full command's first word - pre-tool-use: compute uncovered segments via new compute_unallowed_segments helper in common.sh (filters out readonly auto-allowed + allow/ask matched) - notification: write OSC 777 to /dev/tty instead of stdout (stdout is the hook's JSON response); wrap in DCS tmux; ... ST passthrough when inside tmux so Ghostty can receive the notification through the tmux popup
…atching `go test ./... | tail -50` with user rule `^go` used to fall through to overlay because `tail -50` had no allow rule. But tail IS readonly. Fix: before calling match_all_segments on compound Bash commands, pre-filter out segments that are readonly-auto-allowed (match readonly regex + paths inside cwd/allowed_dirs). The filter is gated on has_redirect=false so `cat file > /tmp/out && ls` still falls through when has_redirect would have blocked the readonly step. Also adds regression tests: - readonly segment covers for compound allow - filter respects has_redirect guard - 2>&1 fd duplication does not trigger has_redirect
The overlay queue lock was scoped to $TMPDIR, which on macOS is often a per-process folder under /var/folders/... - not shared across CC sessions. Two simultaneous CC sessions could each open their own tmux popup, breaking the serialization. Also: when a hook was SIGKILLed (OOM, timeout) the lock directory persisted forever, blocking every subsequent overlay until manually cleared. Fixes: - Lock lives at $(passthru_user_home)/passthru-overlay.lock.d, guaranteed shared across CC sessions of the same user. - New _OVERLAY_LOCK_STALE_AFTER threshold (default 180s, > overlay timeout + margin): if the existing lock's mtime is older than that, clear it and retry. Checked every ~2s during wait. - Default lock timeout raised from 90s to 180s to match typical user response time across multiple queued sessions.
…ook ordering - correct stale 75s hook timeout reference (actual is 300s) - new "Overlay queue lock (cross-session)" section: user-home lock path, macOS TMPDIR caveat, stale-lock recovery - new "Interaction with CC's native permission system" section: decision cascade that explains why "ask" triggers native dialog, and how multi-plugin hook ordering causes passthru to see either original or wrapped (rtk) commands - new "Notifications on overlay prompt" section: /dev/tty requirement and tmux DCS passthrough wrapping - document PASSTHRU_OVERLAY_LOCK_TIMEOUT, PASSTHRU_OVERLAY_LOCK_STALE_AFTER, and PASSTHRU_OVERLAY_UNALLOWED_SEGMENTS env vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ls && weird_cmdsuggests^weird_cmd...$, not^ls...$/dev/ttyinstead of stdout (stdout was being captured as the hook's JSON response and lost). Inside tmux, wraps the OSC in DCStmux; ... STpassthrough so Ghostty receives the notification through the popup. Requiresset -g allow-passthrough onin tmux.conf.Test plan
compute_unallowed_segments(5 cases: readonly filter, allow-rule filter, all-readonly, no-coverage, invalid-path)ls && weird_cmd, verify suggested rule targetsweird_cmdecho "very long text...") and verify full text is wrapped, not truncatedallow-passthrough onin tmux)