diff --git a/README.md b/README.md index fa272db..196cd9d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,15 @@ Useful flags: --recreate ``` +By default, the launcher creates a fresh temporary Zellij config directory for each new session. +This is intentional: it avoids interference from an existing user Zellij config, custom default +layouts, plugins, or resurrected session state. If you really want to use a specific Zellij config +directory, pass: + +```bash +./scripts/zellij-ai-triple.sh --zellij-config-dir /path/to/zellij-config +``` + On first launch of each Codex pane, if `auth.json` is missing in its profile, the pane runs: ```bash diff --git a/scripts/zellij-ai-codex-pane.sh b/scripts/zellij-ai-codex-pane.sh index a24384d..62a0d95 100755 --- a/scripts/zellij-ai-codex-pane.sh +++ b/scripts/zellij-ai-codex-pane.sh @@ -66,6 +66,12 @@ workspace="${ZELLIJ_AI_WORKSPACE:-$PWD}" image="${ZELLIJ_AI_CODEX_IMAGE:-codercom/code-server:latest}" main_codex_config="${ZELLIJ_AI_MAIN_CODEX_CONFIG:-$HOME/.codex/config.toml}" codex_binary="$(find_codex_binary || true)" +term_value="${ZELLIJ_AI_CODEX_TERM:-${TERM:-xterm-256color}}" +color_term_value="${COLORTERM:-truecolor}" + +if [[ "$term_value" == "dumb" ]]; then + term_value="xterm-256color" +fi if [[ ! -d "$workspace" ]]; then echo "Workspace not found: $workspace" >&2 @@ -136,8 +142,8 @@ docker_args=( -e HOME=/codex-home -e CODEX_HOME=/codex-home -e USER="${USER:-$(id -un)}" - -e TERM="${TERM:-xterm-256color}" - -e COLORTERM="${COLORTERM:-truecolor}" + -e TERM="$term_value" + -e COLORTERM="$color_term_value" -e LANG="${LANG:-C.UTF-8}" -v "${workspace}:/workspace" -v "${profile_dir}:/codex-home" diff --git a/scripts/zellij-ai-triple.sh b/scripts/zellij-ai-triple.sh index 48e8311..64aa881 100755 --- a/scripts/zellij-ai-triple.sh +++ b/scripts/zellij-ai-triple.sh @@ -29,6 +29,9 @@ Options: --codex2-label LABEL Display label for the second Codex pane default: codex-2 --claude-config DIR Optional CLAUDE_CONFIG_DIR override for the Claude pane + --zellij-config-dir DIR + Optional isolated Zellij config dir to use for session creation + default: a fresh temporary config dir per new session --recreate Kill the existing session before recreating it -h, --help Show this help EOF @@ -54,6 +57,7 @@ codex2_home="$HOME/.codex-profiles/codex-2" codex1_label="codex-1" codex2_label="codex-2" claude_config_dir="" +zellij_config_dir="" recreate=false while [[ $# -gt 0 ]]; do @@ -90,6 +94,10 @@ while [[ $# -gt 0 ]]; do claude_config_dir="$2" shift 2 ;; + --zellij-config-dir) + zellij_config_dir="$2" + shift 2 + ;; --recreate) recreate=true shift @@ -156,14 +164,22 @@ rm -f "$bootstrap_file" bootstrap_path="$(kdl_escape "$script_dir/zellij-ai-bootstrap.sh")" cat >"$layout_file" <