WORKING: Fix split CWD inheritance and bash job notification spam

- 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>
This commit is contained in:
jleechan 2026-03-04 21:57:01 -08:00
parent 2712cabac9
commit 648f4c00db
3 changed files with 188 additions and 0 deletions

View file

@ -82,6 +82,11 @@ _cmux_prompt_command() {
[[ -n "$CMUX_TAB_ID" ]] || return 0
[[ -n "$CMUX_PANEL_ID" ]] || return 0
# Suppress bash job-done notifications for background tasks spawned below.
# Without this, every completed async probe prints "[N] Done ..." to the terminal.
local _cmux_old_monitor="${-//[^m]/}"
set +m
local now=$SECONDS
local pwd="$PWD"
@ -205,6 +210,9 @@ _cmux_prompt_command() {
if (( now - _CMUX_PORTS_LAST_RUN >= 10 )); then
_cmux_ports_kick
fi
# Restore job control if it was previously enabled.
[[ -n "$_cmux_old_monitor" ]] && set -m
}
_cmux_install_prompt_command() {