You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ai-dev): stop entrypoint clobbering host ~/.local/bin and resolve TERM=xterm-ghostty (#182)
## Summary
Fixes to the `ai-dev` and `nvim-dev` development container environments.
### 1. Stop the ai-dev entrypoint clobbering host
`~/.local/bin/{claude,agy}`
`ai-entrypoint.sh` force-symlinked `$HOME/.local/bin/{claude,agy}` (and
`$HOME/.local/share/claude`) to their `/home/linuxbrew` install paths.
Because the wrappers mount the current directory at its real path (`-v
"$(pwd):$(pwd):rw"`) and `$HOME` is the host home, running
`claude`/`agy` from the home directory wrote those symlinks straight to
the host — replacing the real `~/.local/bin/claude` and
`~/.local/bin/agy` wrapper scripts with dangling links into the image
(which looked like Homebrew packages because `linuxbrew` is the build
user, though both tools are actually curl-installed).
The tools are already on `PATH` via `/home/linuxbrew/.local/bin`, so the
symlinks were redundant. Removed the symlink block entirely.
### 2. Resolve `TERM=xterm-ghostty` in the ai-dev container
The ai-dev wrappers never propagated `TERM`, so podman defaulted it to a
generic value and Ghostty's terminal capabilities were lost, producing
awkward escape sequences in the Claude Code / Antigravity TUIs.
- Pass `TERM` through to the container in `claude.sh` / `agy.sh` /
`enter.sh`
- Install the `xterm-ghostty` terminfo explicitly in the ai-dev image so
it is self-sufficient even if the nvim-dev base changes
- Add an entrypoint fallback to `xterm-256color` when `TERM` is empty or
has no terminfo entry
### 3. `xterm-ghostty` TERM fallback safety net in nvim-dev
nvim-dev already bakes the `xterm-ghostty` terminfo and inherits `TERM`
from the host via distrobox. Added a shell-init fallback (POSIX
`/etc/profile.d` + fish `conf.d`) that degrades to `xterm-256color` when
`TERM` has no terminfo entry, so interactive TUIs never emit raw escape
sequences if `xterm-ghostty` is ever unavailable.
## Recovery for already-broken ai-dev installs
```bash
rm -f ~/.local/bin/claude ~/.local/bin/agy ~/.local/share/claude
just ai-setup # re-copies the wrapper scripts into ~/.local/bin
```
## Notes
Changes under `dot_files/ai-dev/**` and `dot_files/nvim/**` trigger the
`build-ai-dev.yml` / `build-nvim-dev.yml` workflows; the image fixes
take effect after a rebuild + `just ai-upgrade` / re-create of the
distrobox container.
https://claude.ai/code/session_01WQzgxRCuruWxbRv66shWeQ
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments