* Reduce shell integration prompt latency
Three changes to cut ~10-15ms from every precmd/preexec cycle:
1. Use zsh/net/unix (zsocket) for socket sends when available. Eliminates
fork+exec of ncat/socat/nc for every telemetry send (~3ms per send,
3-4 sends per prompt cycle). Falls back to external tools if the
module is unavailable.
2. Replace _cmux_kill_process_tree (synchronous /bin/ps -ax | awk) with
direct kill in _cmux_stop_pr_poll_loop. The tree-kill enumerated all
system processes on every command (~5-13ms). Orphaned children (gh,
sleep) finish on their own within seconds.
3. Minor savings: guard _cmux_patch_ghostty_semantic_redraw after first
success, make _cmux_clear_pr_for_panel async, cache bash send tool.
* Address review: process-group kill, fix clear_pr race, reorder bash init
1. Use kill -KILL -- -$PID (process-group kill) instead of plain kill.
Background jobs are process-group leaders, so this kills all
descendants (gh, sleep) without /bin/ps overhead.
2. Keep bash _cmux_clear_pr_for_panel synchronous to prevent race
with the next report_pr from the poll loop. Zsh version uses
_cmux_send_bg which is synchronous when zsocket is available.
3. Move _cmux_detect_send_tool after _cmux_fix_path in bash so the
cached tool lookup runs with the final PATH.
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
The socat path in _cmux_send did not redirect stdout/stderr, causing
the cmux socket's "OK" response to print to the user's terminal on
every shell integration event (new tab, cd, precmd, preexec).
The ncat path avoids this via --send-only, and the nc path already
redirects to /dev/null. This aligns the socat path with both.
Fixes#1618
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When socket connection mode is not 'off', the shell integration runs
_cmux_stop_pr_poll_loop in the preexec hook before every command.
This function had a blocking 'sleep 0.1' call that caused noticeable
lag on every command execution.
The fix replaces the TERM+sleep+KILL pattern with direct SIGKILL.
The PR poll loop is a lightweight background process that only runs
'gh pr view' periodically - it's safe to kill abruptly without
waiting for graceful termination.
Fixes#1436
Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
* Fix sidebar branch refresh after checkout
* Fix bash PR probe not refreshing on checkout (PR review feedback)
When HEAD changes (e.g. git checkout), the bash integration now resets
_CMUX_PR_LAST_RUN=0 so the PR probe is forced to re-run immediately.
This matches the zsh integration which already sets _CMUX_PR_FORCE=1
on HEAD change.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
set +m only suppresses notifications for jobs started after it runs.
Jobs that complete between prompts still trigger Done output.
Using disown removes jobs from bash job table entirely so bash
never prints completion notifications for them.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Pass inherited working directory when creating split panes (panelDirectories
fallback to currentDirectory)
- Suppress bash job-done "[N] Done ..." notifications in shell integration
by toggling job control (set +m / set -m) around background probes
- Add integration test for split/tab CWD inheritance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Move port scanning from shell to app-side with batching
Replace per-shell `ps -axo + lsof` scanning with a centralized
PortScanner singleton in the app. Each shell now sends lightweight
`report_tty` (once per session) and `ports_kick` (on preexec/precmd)
socket messages. The app coalesces kicks across all panels and runs a
single `ps -t <ttys> + lsof -p <pids>` covering every active panel.
Also fixes a macOS 26 Tahoe regression where `getsockopt(LOCAL_PEERPID)`
returns ENOTCONN on accepted sockets when the peer disconnects before
the handler thread starts. This was silently breaking ALL socket
commands sent via ncat --send-only. The fix captures the peer PID in
the accept loop immediately after accept(), and falls back to
LOCAL_PEERCRED (uid check) when the PID lookup fails.
* Fix PR review feedback: burst timing and auth comment clarity
- P2: burstDelays were accumulating (0.5+1.5+3+... = ~22.5s) instead of
firing at absolute offsets from burst start. Now uses burstStart anchor
so scans fire at 0.5s, 1.5s, 3s, 5s, 7.5s, 10s as intended.
- P1: Clarify LOCAL_PEERCRED fallback rationale — same security boundary
as socket file permissions (0600), does not widen attack surface.
Long-lived connections still get full descendant check via LOCAL_PEERPID.
Instead of creating a merged config directory and injecting
CLAUDE_CONFIG_DIR on every terminal spawn, place a thin wrapper
script at Resources/bin/claude that intercepts claude invocations
to inject --session-id and --settings flags. This eliminates
blocking I/O on terminal creation and removes config management
complexity.
- Add Resources/bin/claude wrapper script with hook injection
- Add shell integration PATH fix (re-prepend after .zshrc/.bashrc)
- Add transcript reading for richer stop notifications
- Add set_status/clear_status to notifications socket allowlist
- Add Settings toggle to disable Claude Code integration
- Update docs to reflect automatic integration approach
- Unset CLAUDECODE env var to avoid nested session detection