Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/swift-file-length-budget.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Reduce counts as files shrink. CI fails if tracked files exceed this budget.
33857 CLI/cmux.swift
17914 Sources/AppDelegate.swift
16740 Sources/ContentView.swift
16709 Sources/ContentView.swift
14612 Sources/TerminalController.swift
13595 Sources/Panels/BrowserPanel.swift
12088 Sources/GhosttyTerminalView.swift
Expand All @@ -13,15 +13,15 @@
7911 Sources/Panels/BrowserPanelView.swift
7350 cmuxTests/WorkspaceUnitTests.swift
6944 cmuxTests/WorkspaceRemoteConnectionTests.swift
6363 cmuxTests/GhosttyConfigTests.swift
6317 cmuxTests/SessionPersistenceTests.swift
6299 cmuxTests/GhosttyConfigTests.swift
6153 CLI/cmux_open.swift
6074 Sources/TabManager.swift
6074 Sources/TextBoxInput.swift
5925 cmuxTests/TerminalAndGhosttyTests.swift
5522 cmuxTests/BrowserConfigTests.swift
4921 Sources/cmuxApp.swift
5113 Packages/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite.swift
4921 Sources/cmuxApp.swift
4460 Sources/Panels/FilePreviewPanel.swift
4400 cmuxTests/BrowserPanelTests.swift
4227 Sources/BrowserWindowPortal.swift
Expand All @@ -32,7 +32,7 @@
3664 Packages/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift
3397 Sources/CmuxConfig.swift
3331 cmuxTests/TabManagerSessionSnapshotTests.swift
3204 Sources/Update/UpdateTitlebarAccessory.swift
3200 Sources/Update/UpdateTitlebarAccessory.swift
2878 Sources/SessionIndexView.swift
2871 cmuxTests/CMUXOpenCommandTests.swift
2573 Sources/KeyboardShortcutSettings.swift
Expand All @@ -59,11 +59,11 @@
1652 cmuxTests/CMUXCLIErrorOutputRegressionTests.swift
1574 cmuxTests/MarkdownPanelTests.swift
1560 cmuxTests/TextBoxMentionCompletionTests.swift
1498 cmuxTests/OmnibarAndToolsTests.swift
1497 cmuxTests/OmnibarAndToolsTests.swift
1496 cmuxUITests/MultiWindowNotificationsUITests.swift
1446 Sources/FileExplorerStore.swift
1380 cmuxUITests/MenuKeyEquivalentRoutingUITests.swift
1382 cmuxTests/KeyboardShortcutSettingsFileStoreStartupTests.swift
1380 cmuxUITests/MenuKeyEquivalentRoutingUITests.swift
1373 cmuxTests/AppDelegateIssue2907RoutingTests.swift
1366 Sources/Feed/FeedButtonStyleDebugWindowController.swift
1362 Sources/CMUXInstalledExtensionSidebarHostView.swift
Expand Down Expand Up @@ -92,9 +92,9 @@
937 Sources/TextBoxMentionIndexStore.swift
934 Sources/App/ShortcutRoutingSupport.swift
926 Sources/DockPanelView.swift
920 Sources/CommandPalette/CommandPaletteSettingsToggle.swift
919 Packages/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+RuntimeLifecycle.swift
918 cmuxTests/WorkspaceGroupTests.swift
920 Sources/CommandPalette/CommandPaletteSettingsToggle.swift
905 Sources/CmuxSSHURLRequest.swift
901 Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/AppSection.swift
893 Sources/WorkspaceContentView.swift
Expand All @@ -117,13 +117,14 @@
752 cmuxUITests/CloseWorkspaceCmdDUITests.swift
746 Sources/App/MenuBarExtraController.swift
738 Packages/CMUXProjectModel/Sources/CMUXProjectModel/XcodeProjectAdapter.swift
738 Packages/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Coordinator/AuthCoordinator.swift
736 Packages/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Coordinator/AuthCoordinator.swift
726 cmuxTests/CLICodexHookTimeoutRegressionTests.swift
716 Sources/TaskManagerSnapshot.swift
715 Packages/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+Input.swift
715 Sources/AppleScriptSupport.swift
710 Sources/TerminalSSHSessionDetector.swift
706 CLI/CMUXCLI+Config.swift
707 CLI/CMUXCLI+AgentHookDefinitions.swift
706 CLI/CMUXCLI+Config.swift
699 Sources/RightSidebarPanelView.swift
699 cmuxTests/TerminalNotificationClearAllTests.swift
698 cmuxTests/RestorableAgentHookProviderResumeTests.swift
Expand Down Expand Up @@ -187,7 +188,6 @@
528 cmuxTests/CLINotifyProcessTestSupport.swift
528 cmuxUITests/AutomationSocketUITests.swift
527 CLI/CLISocketPathResolver.swift
726 cmuxTests/CLICodexHookTimeoutRegressionTests.swift
523 Packages/CmuxRemoteSession/Sources/CmuxRemoteSession/Session/RemoteSessionCoordinator+PortScan.swift
520 CLI/CMUXCLI+AmpExtension.swift
520 cmuxTests/MainWindowVisibilityControllerTests.swift
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

permissions:
contents: read
actions: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -532,6 +531,31 @@ jobs:
bun run agent-session-web:test
git diff --exit-code -- Resources/agent-session-react Resources/agent-session-solid

- name: Ensure Bash 5.3 for shell integration regression
run: |
set -euo pipefail

candidates=("/opt/homebrew/bin/bash" "/usr/local/bin/bash" "$(command -v bash || true)")
for candidate in "${candidates[@]}"; do
if [ -x "$candidate" ] && "$candidate" -c '(( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3) ))'; then
echo "CMUX_TEST_BASH=$candidate" >> "$GITHUB_ENV"
"$candidate" --version | head -1
exit 0
fi
done

brew install bash
for candidate in /opt/homebrew/bin/bash /usr/local/bin/bash; do
if [ -x "$candidate" ] && "$candidate" -c '(( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3) ))'; then
echo "CMUX_TEST_BASH=$candidate" >> "$GITHUB_ENV"
"$candidate" --version | head -1
exit 0
fi
done

echo "Bash >= 5.3 unavailable after brew install" >&2
exit 1

- name: Run CLI no-socket regressions
run: |
set -euo pipefail
Expand All @@ -554,6 +578,7 @@ jobs:
python3 tests/test_stress_cli_socket_api.py
CMUX_CLI_BIN="$CLI_BIN" python3 tests/test_cli_omo_openagent_plugin_migration.py
CMUX_CLI_BIN="$CLI_BIN" python3 tests/test_cli_socket_autodiscovery.py
python3 tests/test_shell_bash_background_helpers_disowned.py
python3 tests/test_claude_wrapper_hooks.py
python3 tests/test_claude_wrapper_user_binary_resolution.py
CMUX_CLI_BIN="$CLI_BIN" python3 tests/test_cli_claude_teams_fallback_path.py
Expand Down
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ App path:
**Claude Code** outputs:

```markdown
=======================================================
-------------------------------------------------------
[cmux DEV my-tag.app](file:///Users/someone/Library/Developer/Xcode/DerivedData/cmux-my-tag/Build/Products/Debug/cmux%20DEV%20my-tag.app)
=======================================================
-------------------------------------------------------
```

**Codex** outputs:

```markdown
=======================================================
-------------------------------------------------------
[my-tag: file:///Users/someone/Library/Developer/Xcode/DerivedData/cmux-my-tag/Build/Products/Debug/cmux%20DEV%20my-tag.app](file:///Users/someone/Library/Developer/Xcode/DerivedData/cmux-my-tag/Build/Products/Debug/cmux%20DEV%20my-tag.app)
=======================================================
-------------------------------------------------------
```

Never use `/tmp/cmux-<tag>/...` app links in chat output.
Expand Down
48 changes: 35 additions & 13 deletions Resources/shell-integration/cmux-bash-integration.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,26 @@ _cmux_send() {
esac
}

_CMUX_BASH_PS0_INLINE_ACTIVE="${_CMUX_BASH_PS0_INLINE_ACTIVE:-0}"
_cmux_run_bg() {
if [[ "${_CMUX_BASH_PS0_INLINE_ACTIVE:-0}" == "1" ]]; then
# Bash 5.3's inline PS0 expansion leaks background jobs into the
# interactive job table. Start the helper from a command-substitution
# subshell so the user shell never owns the job notification.
: "$("$@" >/dev/null 2>&1 & disown "$!" 2>/dev/null || true)"
return 0
fi

( "$@" >/dev/null 2>&1 & disown "$!" 2>/dev/null || true )
}

_cmux_detach_bg() {
( "$@" >/dev/null 2>&1 & ) >/dev/null 2>&1
_cmux_run_bg "$@"
}

_cmux_send_bg() {
local payload="$1"
if [[ "${_CMUX_IN_PREEXEC:-}" == "1" ]]; then
{
_cmux_send "$payload"
} >/dev/null 2>&1 &
disown
return 0
fi
_cmux_detach_bg _cmux_send "$payload"
_cmux_run_bg _cmux_send "$payload"
}

_cmux_start_tracked_bg() {
Expand Down Expand Up @@ -1364,7 +1370,12 @@ _cmux_command_starts_nested_shell() {
}

_cmux_preexec_command() {
local cmd="${1:-${BASH_COMMAND:-}}"
local cmd=""
if (( $# > 0 )); then
cmd="$1"
else
cmd="${BASH_COMMAND:-}"
fi
_cmux_tmux_sync_cmux_environment

local cmux_has_unix_socket=0
Expand Down Expand Up @@ -1417,6 +1428,9 @@ _cmux_bash_history_command() {
_cmux_bash_preexec_hook() {
local cmd="${1:-}"
local history_cmd=""
# Bash 5.3's inline `${ ...; }` PS0 updates BASH_COMMAND to cmux's
# own helper command before function arguments are expanded. Interactive
# history is the stable source for the user command on that path.
history_cmd="$(_cmux_bash_history_command 2>/dev/null || true)"
if [[ -n "$history_cmd" ]]; then
cmd="$history_cmd"
Expand All @@ -1429,6 +1443,14 @@ _cmux_bash_preexec_hook_subshell() {
_cmux_bash_preexec_hook "$@"
}

_cmux_bash_preexec_inline_ps0() {
_CMUX_BASH_PS0_INLINE_ACTIVE=1
{
_cmux_bash_preexec_hook
_CMUX_BASH_PS0_INLINE_ACTIVE=0
} || _CMUX_BASH_PS0_INLINE_ACTIVE=0
}
Comment thread
austinywang marked this conversation as resolved.
Resolved

_cmux_prompt_command() {
local last_status=$?
_cmux_tmux_sync_cmux_environment
Expand Down Expand Up @@ -1601,11 +1623,11 @@ _cmux_install_prompt_command() {
esac
fi

if (( BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4) )); then
if (( BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4) )); then
if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3) )); then
builtin readonly _CMUX_BASH_PS0='${ _cmux_bash_preexec_hook; }'
builtin readonly _CMUX_BASH_PS0='${ _cmux_bash_preexec_inline_ps0; }'
else
builtin readonly _CMUX_BASH_PS0='$(_cmux_bash_preexec_hook_subshell >/dev/null)'
builtin readonly _CMUX_BASH_PS0='$(_cmux_bash_preexec_hook_subshell "$BASH_COMMAND" >/dev/null)'
fi
if [[ "$PS0" != *"${_CMUX_BASH_PS0}"* ]]; then
PS0=$PS0"${_CMUX_BASH_PS0}"
Expand Down
Loading
Loading