Skip to content

snap: export TERMINFO_DIRS so child shells find xterm-ghostty#12662

Merged
kenvandine merged 1 commit into
ghostty-org:mainfrom
aaron-ang:fix/snap-terminfo-dirs
May 20, 2026
Merged

snap: export TERMINFO_DIRS so child shells find xterm-ghostty#12662
kenvandine merged 1 commit into
ghostty-org:mainfrom
aaron-ang:fix/snap-terminfo-dirs

Conversation

@aaron-ang

@aaron-ang aaron-ang commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

When Ghostty is installed via snap on Ubuntu, programs running inside Ghostty (e.g. clear) fail with:

terminals database is inaccessible

The snap ships terminfo at ${SNAP}/share/terminfo but the launcher never exports TERMINFO_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 the xterm-ghostty entry, so the lookup fails.

This is the same fix as the auto-closed #12303 and resolves #12304.

Fix

Export TERMINFO_DIRS in snap/local/launcher so 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/launcher with 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.snap

Then launch /snap/bin/ghostty and run clear.

Test plan

Verified locally on Ubuntu 24.04 / arm64.

  • In default zsh / bash inside Ghostty, clear succeeds.
  • infocmp xterm-ghostty resolves to /snap/ghostty/current/share/terminfo/x/xterm-ghostty.
  • No manual copying of terminfo entries into ~/.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 clear and infocmp xterm-ghostty work without manually copying terminfo entries into ~/.terminfo/ (original workaround shared in the discussion).

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.
@aaron-ang aaron-ang requested a review from a team as a code owner May 12, 2026 05:43
@jcollie

jcollie commented May 12, 2026

Copy link
Copy Markdown
Member

I realize that these patches are both about snaps, but this should be split into two PRs.

@aaron-ang aaron-ang force-pushed the fix/snap-terminfo-dirs branch from 26b7256 to 41878d6 Compare May 14, 2026 02:33
@aaron-ang aaron-ang changed the title snap: fix terminfo and audio bell for Ubuntu installs snap: export TERMINFO_DIRS so child shells find xterm-ghostty May 14, 2026
@aaron-ang

Copy link
Copy Markdown
Contributor Author

I realize that these patches are both about snaps, but this should be split into two PRs.

@jcollie, I've split it into #12676.

@jcollie

jcollie commented May 14, 2026

Copy link
Copy Markdown
Member

You need to disclose your use of AI. See https://github.com/ghostty-org/ghostty/blob/main/AI_POLICY.md

@aaron-ang

Copy link
Copy Markdown
Contributor Author

You need to disclose your use of AI. See main/AI_POLICY.md

added, got my reference from #9857

@kenvandine kenvandine assigned kenvandine and unassigned kenvandine May 14, 2026
@kenvandine kenvandine self-requested a review May 14, 2026 21:07
@kenvandine kenvandine merged commit 2559654 into ghostty-org:main May 20, 2026
92 checks passed
@github-actions github-actions Bot added this to the 1.3.2 milestone May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants