fix: add cmux __tmux-compat prefix to interactive_bash tool

Extract isCmuxCompatEnvironment to shared module and fix
interactive_bash to resolve cmux executables with the __tmux-compat
prefix, matching all other tmux command paths in the codebase.
This commit is contained in:
acamq
2026-05-10 19:29:42 -06:00
parent 8236d7d6b8
commit 0d19c31274
5 changed files with 26 additions and 18 deletions
+11
View File
@@ -0,0 +1,11 @@
/**
* Detect whether we are running inside cmux (cmux omo).
* When cmux-omo sets up the environment it injects a tmux shim and sets
* CMUX_SOCKET_PATH / TMUX. If detected, redirect tmux commands to
* `cmux __tmux-compat` so they become native cmux splits instead of
* failing because there is no real tmux server running.
*/
export function isCmuxCompatEnvironment(): boolean {
return Boolean(process.env.CMUX_SOCKET_PATH) ||
process.env.TMUX?.includes("cmuxterm") === true
}
+1
View File
@@ -1,4 +1,5 @@
export * from "./types"
export * from "./constants"
export * from "./cmux-detect"
export * from "./runner"
export * from "./tmux-utils"
+1 -12
View File
@@ -1,4 +1,5 @@
import { spawn } from "../bun-spawn-shim"
import { isCmuxCompatEnvironment } from "./cmux-detect"
type RunTmuxOptions = {
retry?: number
@@ -29,18 +30,6 @@ function isTerminalTmuxError(stderr: string): boolean {
return TERMINAL_TMUX_ERROR_PATTERN.test(stderr)
}
/**
* Detect whether we are running inside cmux (cmux omo).
* When cmux-omo sets up the environment it injects a tmux shim and sets
* CMUX_SOCKET_PATH / TMUX. If detected, redirect tmux commands to
* `cmux __tmux-compat` so they become native cmux splits instead of
* failing because there is no real tmux server running.
*/
function isCmuxCompatEnvironment(): boolean {
return Boolean(process.env.CMUX_SOCKET_PATH) ||
process.env.TMUX?.includes("cmuxterm") === true
}
function resolveTmuxExecutable(tmuxPath: string): string[] {
if (!isCmuxCompatEnvironment()) {
return [tmuxPath]