cmux/Resources
Lawrence Chen 71828fe86e
Reduce shell integration prompt latency (#2109)
* 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>
2026-03-24 23:08:20 -07:00
..
bin Add -r shorthand to SKIP_SESSION_ID check in claude wrapper (#1992) 2026-03-24 20:26:50 -07:00
ghostty Bundle Ghostty themes in cmux (#1314) 2026-03-13 02:44:57 -07:00
shell-integration Reduce shell integration prompt latency (#2109) 2026-03-24 23:08:20 -07:00
terminfo-overlay Release v1.23.0 (#31) 2026-02-09 15:30:43 -08:00
cmux.sdef Update ghostty to v1.3.0 (#1142) 2026-03-09 21:32:54 -07:00
Info.plist fix: restore Sparkle automatic update checks (#1597) 2026-03-17 03:07:38 -07:00
InfoPlist.xcstrings Add browser camera permission support and metadata (#760) (#913) 2026-03-04 18:56:22 -08:00
Localizable.xcstrings feat: cmux.json for custom commands (#2011) 2026-03-24 22:28:46 -07:00