Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
933eee1
feat: route local file path clicks to markdown panel
Tim-Feng Mar 16, 2026
b45ca48
fix: validate file exists and is not a directory before opening markd…
Tim-Feng Mar 16, 2026
aa52010
fix: fall back to system handler when markdown split creation fails
Tim-Feng Mar 16, 2026
efbbd16
refactor: address CodeRabbit review feedback
Tim-Feng Mar 16, 2026
d84fdbf
docs: tmux control mode integration plan
Tim-Feng Mar 17, 2026
58ecc93
[BEHAVIORAL] Phase 1 tmux control mode bridge
Tim-Feng Mar 17, 2026
6ab1ec2
[BEHAVIORAL] cmd+click path detection in tmux control mode
Tim-Feng Mar 18, 2026
af76ebe
[BEHAVIORAL] Phase 2 tmux pane rendering — native surface per pane
Tim-Feng Mar 18, 2026
251dc33
[BEHAVIORAL] tmux pane IME improvements
Tim-Feng Mar 19, 2026
45fe7d6
[BEHAVIORAL] Terminal.clone initial sync + IME preedit cursor bar
Tim-Feng Mar 19, 2026
507fe43
[BEHAVIORAL] Auto-add -CC for tmux attach/new in shell integration
Tim-Feng Mar 19, 2026
71944b6
[BEHAVIORAL] tmux CC: cmd+click file open, paste, arrow keys, $TMUX fix
Tim-Feng Mar 19, 2026
d70f132
[BEHAVIORAL] tmux CC: route mouseDragged to pane surface for text sel…
Tim-Feng Mar 19, 2026
c7f8704
[BEHAVIORAL] VT parser: absorb ESC k (tmux set-title) to fix pane ren…
Tim-Feng Mar 20, 2026
a31b8a3
[STRUCTURAL] Add parser test for ESC k tmux set-title absorption
Tim-Feng Mar 20, 2026
0220de2
[STRUCTURAL] Revert status bar gap — container covers full area
Tim-Feng Mar 20, 2026
c4237f1
[BEHAVIORAL] tmux CC: native status bar with session/window info
Tim-Feng Mar 20, 2026
9b1e923
[BEHAVIORAL] tmux CC: prefix key layer + detach support
Tim-Feng Mar 20, 2026
384b818
[BEHAVIORAL] tmux CC: initial sync via capture-pane
Tim-Feng Mar 20, 2026
26b7823
[BEHAVIORAL] tmux CC: initial sync with geometry-aware capture-pane
Tim-Feng Mar 20, 2026
3964ae8
[BEHAVIORAL] tmux CC: fix host terminal bleed-through + simplify init…
Tim-Feng Mar 21, 2026
379c59c
[BEHAVIORAL] tmux CC: hide host terminal with alphaValue + cursor-bas…
Tim-Feng Mar 21, 2026
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
37 changes: 37 additions & 0 deletions Resources/shell-integration/cmux-bash-integration.bash
Original file line number Diff line number Diff line change
Expand Up @@ -509,4 +509,41 @@ _cmux_fix_path() {
_cmux_fix_path
unset -f _cmux_fix_path

# tmux auto-CC: when the user runs `tmux attach` or `tmux new-session`
# in an interactive cmux terminal, automatically add -CC so native pane
# rendering activates. Use `command tmux ...` to bypass, or set
# CMUX_TMUX_AUTO_CC=0 to disable globally.
tmux() {
# Opt-out
[[ "${CMUX_TMUX_AUTO_CC:-1}" == "0" ]] && { command tmux "$@"; return $?; }
# Inside cmux, $TMUX may be inherited from the launcher env but
# this terminal is NOT really inside tmux — ignore it.
# Outside cmux (no CMUX_SOCKET_PATH), respect $TMUX as usual.
[[ -z "$CMUX_SOCKET_PATH" && -n "$TMUX" ]] && { command tmux "$@"; return $?; }
[[ "$-" == *i* ]] || { command tmux "$@"; return $?; }
[[ -t 1 ]] || { command tmux "$@"; return $?; }
# Already has -CC or -C
local arg; for arg in "$@"; do
[[ "$arg" == "-CC" || "$arg" == "-C" ]] && { command tmux "$@"; return $?; }
[[ "$arg" == "--" ]] && break
done
# Determine the tmux subcommand (skip global flags that take a value)
local subcmd="" skip_next=0
for arg in "$@"; do
if (( skip_next )); then skip_next=0; continue; fi
case "$arg" in
-L|-S|-f|-c) skip_next=1; continue ;; # these flags consume the next arg

@cubic-dev-ai cubic-dev-ai Bot Mar 20, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: tmux subcommand detection misses -T (a value-taking global flag), which can misparse arguments and break -CC auto-injection.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Resources/shell-integration/cmux-bash-integration.bash, line 535:

<comment>tmux subcommand detection misses `-T` (a value-taking global flag), which can misparse arguments and break `-CC` auto-injection.</comment>

<file context>
@@ -509,4 +509,41 @@ _cmux_fix_path() {
+    for arg in "$@"; do
+        if (( skip_next )); then skip_next=0; continue; fi
+        case "$arg" in
+            -L|-S|-f|-c) skip_next=1; continue ;;  # these flags consume the next arg
+            -*) continue ;;
+            *) subcmd="$arg"; break ;;
</file context>
Suggested change
-L|-S|-f|-c) skip_next=1; continue ;; # these flags consume the next arg
-L|-S|-f|-c|-T) skip_next=1; continue ;; # these flags consume the next arg
Fix with Cubic

-*) continue ;;
*) subcmd="$arg"; break ;;
esac
done
# Only auto-add -CC for commands that start a tmux client
case "$subcmd" in
attach|attach-session|a|new|new-session|"")
command tmux -CC "$@" ;;
*)
command tmux "$@" ;;
esac
}

_cmux_install_prompt_command
38 changes: 38 additions & 0 deletions Resources/shell-integration/cmux-zsh-integration.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,46 @@ _cmux_zshexit() {
_cmux_stop_pr_poll_loop
}

# tmux auto-CC: installed on first prompt (after .zshrc) so user plugins
# cannot shadow it. Use `command tmux ...` to bypass, or set
# CMUX_TMUX_AUTO_CC=0 to disable globally.
_cmux_install_tmux_wrapper() {
# Define/redefine the tmux function, overriding any plugin definition
tmux() {
[[ "${CMUX_TMUX_AUTO_CC:-1}" == "0" ]] && { command tmux "$@"; return $?; }
# Inside cmux, $TMUX may be inherited from the launcher env but
# this terminal is NOT really inside tmux — ignore it.
# Outside cmux (no CMUX_SOCKET_PATH), respect $TMUX as usual.
[[ -z "$CMUX_SOCKET_PATH" && -n "$TMUX" ]] && { command tmux "$@"; return $?; }
[[ -o interactive ]] || { command tmux "$@"; return $?; }
[[ -t 1 ]] || { command tmux "$@"; return $?; }
local arg; for arg in "$@"; do
[[ "$arg" == "-CC" || "$arg" == "-C" ]] && { command tmux "$@"; return $?; }
[[ "$arg" == "--" ]] && break
done
local subcmd="" skip_next=0
for arg in "$@"; do
if (( skip_next )); then skip_next=0; continue; fi
case "$arg" in
-L|-S|-f|-c) skip_next=1; continue ;;

@cubic-dev-ai cubic-dev-ai Bot Mar 20, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: tmux subcommand detection misses valid global options with arguments (e.g. -T), causing auto -CC injection to be skipped for attach/new flows.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Resources/shell-integration/cmux-zsh-integration.zsh, line 591:

<comment>tmux subcommand detection misses valid global options with arguments (e.g. `-T`), causing auto `-CC` injection to be skipped for attach/new flows.</comment>

<file context>
@@ -567,8 +567,46 @@ _cmux_zshexit() {
+        for arg in "$@"; do
+            if (( skip_next )); then skip_next=0; continue; fi
+            case "$arg" in
+                -L|-S|-f|-c) skip_next=1; continue ;;
+                -*) continue ;;
+                *) subcmd="$arg"; break ;;
</file context>
Suggested change
-L|-S|-f|-c) skip_next=1; continue ;;
-L|-S|-f|-c|-T) skip_next=1; continue ;;
Fix with Cubic

-*) continue ;;
*) subcmd="$arg"; break ;;
esac
done
case "$subcmd" in
attach|attach-session|a|new|new-session|"")
command tmux -CC "$@" ;;
*)
command tmux "$@" ;;
esac
}
# Only need to install once
add-zsh-hook -d precmd _cmux_install_tmux_wrapper
}

autoload -Uz add-zsh-hook
add-zsh-hook preexec _cmux_preexec
add-zsh-hook precmd _cmux_precmd
add-zsh-hook precmd _cmux_fix_path
add-zsh-hook precmd _cmux_install_tmux_wrapper
add-zsh-hook zshexit _cmux_zshexit
Loading