cmuxterm

Environment Variables

Environment variables for configuring cmuxterm

Environment Variables

cmuxterm uses environment variables for configuration and integration.

Socket Control

CMUX_SOCKET_PATH

Override the default socket path.

export CMUX_SOCKET_PATH=/custom/path/cmuxterm.sock

Default: /tmp/cmuxterm.sock (release) or /tmp/cmuxterm-debug.sock (debug)

CMUX_SOCKET_ENABLE

Enable or disable the control socket.

export CMUX_SOCKET_ENABLE=1   # Enable
export CMUX_SOCKET_ENABLE=0   # Disable

Values: 1, 0, true, false, yes, no

CMUX_SOCKET_MODE

Override the socket access mode.

export CMUX_SOCKET_MODE=notifications  # Notifications only
export CMUX_SOCKET_MODE=full           # Full control
export CMUX_SOCKET_MODE=off            # Disabled

CLI Context

CMUX_TAB_ID

Default tab ID for CLI commands.

export CMUX_TAB_ID=abc123
cmuxterm send "hello"  # Sends to tab abc123

cmuxterm automatically sets this in each terminal session.

CMUX_PANEL_ID

Default panel ID for CLI commands.

export CMUX_PANEL_ID=xyz789
cmuxterm send-panel "hello"  # Sends to panel xyz789

cmuxterm automatically sets this for each split pane.

Terminal Environment

cmuxterm sets these variables in terminal sessions:

TERM

Terminal type for compatibility.

TERM=xterm-ghostty

TERM_PROGRAM

Identifies the terminal application.

TERM_PROGRAM=ghostty

cmuxterm sets this to ghostty since it's built on Ghostty. Use the socket check to distinguish from regular Ghostty.

GHOSTTY_RESOURCES_DIR

Path to Ghostty resources.

GHOSTTY_RESOURCES_DIR=/path/to/resources

Testing & Debug

CMUX_UI_TEST_SHOW_SETTINGS

Show the settings window on app launch (for UI testing).

export CMUX_UI_TEST_SHOW_SETTINGS=1

CMUX_UI_TEST_TRIGGER_UPDATE_CHECK

Trigger an update check on app launch (for testing).

export CMUX_UI_TEST_TRIGGER_UPDATE_CHECK=1

CMUX_COMMIT

Override the commit hash displayed in the About window.

export CMUX_COMMIT=abc1234

Detection Script

Check if running inside cmuxterm:

#!/bin/bash
 
is_cmuxterm() {
    # Check for cmuxterm socket
    if [ -S "${CMUX_SOCKET_PATH:-/tmp/cmuxterm.sock}" ]; then
        return 0
    fi
    return 1
}
 
if is_cmuxterm; then
    echo "Running in cmuxterm"
    echo "Tab ID: ${CMUX_TAB_ID:-unknown}"
    echo "Panel ID: ${CMUX_PANEL_ID:-unknown}"
else
    echo "Not in cmuxterm"
fi

Shell Configuration

Add to your ~/.bashrc or ~/.zshrc:

# cmuxterm integration
if [ -S "${CMUX_SOCKET_PATH:-/tmp/cmuxterm.sock}" ]; then
    # We're in cmuxterm
 
    # Function to notify on long commands
    notify_done() {
        "$@"
        local exit_code=$?
        cmuxterm notify --title "Command Complete" --body "$1"
        return $exit_code
    }
 
    # Alias for builds
    alias build='notify_done npm run build'
fi

Precedence

Environment variables override app settings:

  1. Environment variable (if set)
  2. App settings (Settings window)
  3. Default value

For example, if CMUX_SOCKET_MODE=full is set, it overrides the app's Automation Mode setting.