Skip to content

Conversation

@Microdent
Copy link

Summary

When users set a custom CODEX_BIN_DIR, the installer and tmux integration previously still hardcoded ~/.local/bin in a few places. This made the installed helper scripts and PATH configuration inconsistent with the configured bin directory.

This PR removes the remaining ~/.local/bin coupling and makes tmux integration fully honor CODEX_BIN_DIR end-to-end.

What changed

  • Installer PATH setup now appends the configured BIN_DIR (derived from CODEX_BIN_DIR) instead of ~/.local/bin.
  • tmux helper scripts are installed/uninstalled into/from BIN_DIR.
  • tmux config no longer hardcodes ~/.local/bin; it uses an install-time placeholder replacement so key bindings point to the correct BIN_DIR.
  • ccb-tmux-on.sh no longer assumes helper scripts live in ~/.local/bin; it resolves helper paths relative to its own location.

Why

Customizing CODEX_BIN_DIR should be a supported workflow (e.g., shared tool directories, non-default HOME layouts, container/WSL setups). Hardcoding ~/.local/bin breaks that expectation and causes “installed but not found” behavior in tmux keybindings / status helpers.

Backward compatibility

  • Default behavior remains unchanged for users who keep the default CODEX_BIN_DIR (i.e., ~/.local/bin).
  • Users with an existing tmux block will have it refreshed by the installer update path.

Testing

  • Ran bash -n install.sh and bash -n ccb-tmux-on.sh config/ccb-tmux-off.sh.
  • Manual sanity check: verified generated tmux config points to the configured BIN_DIR.

How to verify (manual)

  1. Run: CODEX_BIN_DIR=/your/custom/bin CODEX_INSTALL_PREFIX=/your/prefix install.sh install
  2. Confirm the helper scripts exist in /your/custom/bin (e.g., ccb-tmux-on.sh, ccb-border.sh, ccb-status.sh).
  3. Reload tmux config: tmux source-file ~/.tmux.conf
  4. In tmux, use the provided keybindings to toggle CCB theming and confirm no references to ~/.local/bin remain in the active workflow.

Notes

Windows installer paths were reviewed; no analogous ~/.local/bin assumption exists there, so no changes were required.

Copilot AI review requested due to automatic review settings January 12, 2026 18:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes hardcoded ~/.local/bin references in the installer and tmux integration, making them respect the user-configured CODEX_BIN_DIR environment variable. This enables users to install helper scripts to custom directories.

Changes:

  • Updated PATH configuration to use the configured BIN_DIR instead of hardcoded ~/.local/bin
  • Modified tmux helper script installation paths to use BIN_DIR
  • Implemented placeholder replacement in tmux config to dynamically inject the correct BIN_DIR path
  • Updated ccb-tmux-on.sh to resolve helper script paths relative to its own location

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
install.sh Updates PATH setup, tmux script installation paths, and implements @CCB_BIN_DIR@ placeholder replacement in tmux config
config/tmux-ccb.conf Replaces hardcoded paths with @CCB_BIN_DIR@ placeholder and tmux variable references
config/ccb-tmux-on.sh Resolves helper script paths dynamically relative to script location instead of assuming ~/.local/bin

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1067 to +1071
"$PYTHON_BIN" -c "
import sys
path = '$ccb_tmux_conf'
bin_dir = '$BIN_DIR'
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The shell variables $ccb_tmux_conf and $BIN_DIR are directly interpolated into Python single-quoted strings without proper escaping. If BIN_DIR contains single quotes, backslashes, or other special characters, the Python code will have a syntax error.

Consider using proper escaping or passing these values as command-line arguments to Python, or using a different delimiter that won't conflict with path characters.

Suggested change
"$PYTHON_BIN" -c "
import sys
path = '$ccb_tmux_conf'
bin_dir = '$BIN_DIR'
CCB_TMUX_CONF="$ccb_tmux_conf" CCB_BIN_DIR="$BIN_DIR" "$PYTHON_BIN" -c "
import os
import sys
path = os.environ.get('CCB_TMUX_CONF')
bin_dir = os.environ.get('CCB_BIN_DIR', '')

Copilot uses AI. Check for mistakes.
Comment on lines +1076 to +1078
else
cat "$ccb_tmux_conf"
fi
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

When Python is not available, the fallback simply cats the config file without replacing the @CCB_BIN_DIR@ placeholders. This means the tmux keybindings at lines 130-131 in the config file will reference the literal string @CCB_BIN_DIR@ instead of the actual bin directory path, causing them to fail.

Consider using sed as a fallback to perform the replacement, which is more universally available than Python.

Copilot uses AI. Check for mistakes.
@bfly123 bfly123 merged commit 81cf8d5 into bfly123:main Jan 13, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants