MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isTmuxControlModeEnvHeuristic

Function isTmuxControlModeEnvHeuristic

src/utils/fullscreen.ts:29–36  ·  view source on GitHub ↗

* Env-var heuristic for iTerm2's tmux integration mode (`tmux -CC` / `tmux -2CC`). * * In `-CC` mode, iTerm2 renders tmux panes as native splits — tmux runs * as a server (TMUX is set) but iTerm2 is the actual terminal emulator * for each pane, so TERM_PROGRAM stays `iTerm.app` and TERM is iTerm

()

Source from the content-addressed store, hash-verified

27 * authoritative backstop. Kept as a zero-subprocess fast path.
28 */
29function isTmuxControlModeEnvHeuristic(): boolean {
30 if (!process.env.TMUX) return false
31 if (process.env.TERM_PROGRAM !== 'iTerm.app') return false
32 // Belt-and-suspenders: in regular tmux TERM is screen-* or tmux-*;
33 // in -CC mode iTerm2 sets its own TERM (xterm-*).
34 const term = process.env.TERM ?? ''
35 return !term.startsWith('screen') && !term.startsWith('tmux')
36}
37
38/**
39 * Sync one-shot probe: asks tmux directly whether this client is in control

Callers 1

probeTmuxControlModeSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected