fix(ai-dev): stop entrypoint clobbering host ~/.local/bin and resolve TERM=xterm-ghostty#182
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes to the
ai-devandnvim-devdevelopment container environments.1. Stop the ai-dev entrypoint clobbering host
~/.local/bin/{claude,agy}ai-entrypoint.shforce-symlinked$HOME/.local/bin/{claude,agy}(and$HOME/.local/share/claude) to their/home/linuxbrewinstall paths. Because the wrappers mount the current directory at its real path (-v "$(pwd):$(pwd):rw") and$HOMEis the host home, runningclaude/agyfrom the home directory wrote those symlinks straight to the host — replacing the real~/.local/bin/claudeand~/.local/bin/agywrapper scripts with dangling links into the image (which looked like Homebrew packages becauselinuxbrewis the build user, though both tools are actually curl-installed).The tools are already on
PATHvia/home/linuxbrew/.local/bin, so the symlinks were redundant. Removed the symlink block entirely.2. Resolve
TERM=xterm-ghosttyin the ai-dev containerThe 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.TERMthrough to the container inclaude.sh/agy.sh/enter.shxterm-ghosttyterminfo explicitly in the ai-dev image so it is self-sufficient even if the nvim-dev base changesxterm-256colorwhenTERMis empty or has no terminfo entry3.
xterm-ghosttyTERM fallback safety net in nvim-devnvim-dev already bakes the
xterm-ghosttyterminfo and inheritsTERMfrom the host via distrobox. Added a shell-init fallback (POSIX/etc/profile.d+ fishconf.d) that degrades toxterm-256colorwhenTERMhas no terminfo entry, so interactive TUIs never emit raw escape sequences ifxterm-ghosttyis ever unavailable.Recovery for already-broken ai-dev installs
Notes
Changes under
dot_files/ai-dev/**anddot_files/nvim/**trigger thebuild-ai-dev.yml/build-nvim-dev.ymlworkflows; the image fixes take effect after a rebuild +just ai-upgrade/ re-create of the distrobox container.https://claude.ai/code/session_01WQzgxRCuruWxbRv66shWeQ