snap: export TERMINFO_DIRS so child shells find xterm-ghostty#12662
Merged
Conversation
Without this, shells spawned by ghostty cannot find the xterm-ghostty terminfo entry because ncurses only searches standard system paths. The snap's terminfo lives inside the snap sandbox and is inaccessible unless TERMINFO_DIRS is set explicitly.
Member
|
I realize that these patches are both about snaps, but this should be split into two PRs. |
26b7256 to
41878d6
Compare
2 tasks
Contributor
Author
Member
|
You need to disclose your use of AI. See https://github.com/ghostty-org/ghostty/blob/main/AI_POLICY.md |
Contributor
Author
added, got my reference from #9857 |
kenvandine
approved these changes
May 20, 2026
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
When Ghostty is installed via snap on Ubuntu, programs running inside Ghostty (e.g.
clear) fail with:The snap ships terminfo at
${SNAP}/share/terminfobut the launcher never exportsTERMINFO_DIRS, so ncurses in child shells falls back to the host's system database. On Ubuntu 24.04 (ncurses 6.4) the system database predates thexterm-ghosttyentry, so the lookup fails.This is the same fix as the auto-closed #12303 and resolves #12304.
Fix
Export
TERMINFO_DIRSinsnap/local/launcherso all child processes can resolve the bundled entry without manual setup.Local build (how this PR was verified)
Remix the installed store snap by swapping
app/launcherwith the patched one:sudo unsquashfs -d /tmp/g \ /var/lib/snapd/snaps/ghostty_$(readlink /snap/ghostty/current).snap sudo cp snap/local/launcher /tmp/g/app/launcher sudo mksquashfs /tmp/g /tmp/ghostty-test.snap -comp xz -noappend sudo snap install --dangerous --classic /tmp/ghostty-test.snapThen launch
/snap/bin/ghosttyand runclear.Test plan
Verified locally on Ubuntu 24.04 / arm64.
zsh/bashinside Ghostty,clearsucceeds.infocmp xterm-ghosttyresolves to/snap/ghostty/current/share/terminfo/x/xterm-ghostty.~/.terminfo/required.AI Disclosure
Claude Code was used to investigate the root cause and to draft this single-line launcher change. The fix is identical to the proposal in the linked discussion (#12304). I manually verified by remixing the installed snap with the patched launcher and confirming
clearandinfocmp xterm-ghosttywork without manually copying terminfo entries into~/.terminfo/(original workaround shared in the discussion).