Skip to content

fix(ai-dev): stop entrypoint clobbering host ~/.local/bin and resolve TERM=xterm-ghostty#182

Merged
binarypie merged 3 commits into
mainfrom
claude/optimistic-tesla-nypfi2
Jun 14, 2026
Merged

fix(ai-dev): stop entrypoint clobbering host ~/.local/bin and resolve TERM=xterm-ghostty#182
binarypie merged 3 commits into
mainfrom
claude/optimistic-tesla-nypfi2

Conversation

@binarypie

@binarypie binarypie commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

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

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

claude added 3 commits June 14, 2026 13:34
The entrypoint force-symlinked $HOME/.local/bin/{claude,agy} and
$HOME/.local/share/claude to their /home/linuxbrew install paths. Since
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 wrapper scripts with
dangling links into the image.

The tools are already on PATH via /home/linuxbrew/.local/bin, so the symlinks
were redundant. Remove the symlink block entirely.

https://claude.ai/code/session_01WQzgxRCuruWxbRv66shWeQ
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, so programs never emit raw escape sequences

https://claude.ai/code/session_01WQzgxRCuruWxbRv66shWeQ
nvim-dev already bakes the xterm-ghostty terminfo and inherits TERM from
the host via distrobox. Add a shell-init fallback (POSIX + fish) that
degrades to xterm-256color when TERM has no terminfo entry, so interactive
TUIs never emit raw/awkward escape sequences if xterm-ghostty is ever
unavailable. Also clarify the terminfo layer comment.

https://claude.ai/code/session_01WQzgxRCuruWxbRv66shWeQ
@binarypie binarypie merged commit 3c70fb8 into main Jun 14, 2026
7 checks passed
@binarypie binarypie deleted the claude/optimistic-tesla-nypfi2 branch June 14, 2026 14:12
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