Commit Graph

15 Commits (main)

Author SHA1 Message Date
Aaron Ang 41878d6f79 snap: export TERMINFO_DIRS so child shells find xterm-ghostty
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.
2026-04-15 22:42:51 -04:00
Ken VanDine c16cf0ef07 fix: Ensure snap paths come first in gio module loading 2026-04-01 13:30:40 -04:00
04cb 4bb602b0e1 Fix snap EGL vendor dirs to include host NVIDIA ICD paths 2026-03-07 18:02:59 +08:00
Maciek Borzecki 49768c6464 snap: fix handling of nonexistent last_revision file
Assuming /bin/sh is symlinked to bash, the handling of special builtin
'source' is slightly different between bash and bash-in-POSIX-mode (as a
result of being invoked through /bin/sh). Specifically errors in builtin
'source' cannot be masked with `|| true`. Compare

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Dec 11 11:00 /bin/sh -> bash
$ /bin/sh -c 'set -e ; source nofile || true; echo ok'
/bin/sh: line 1: source: nofile: file not found
$ /bin/bash -c 'set -e ; source nofile || true; echo ok'
/bin/bash: line 1: nofile: No such file or directory
ok

Thus ghostty from snap would not start at all when
$SNAP_USER_DATA/.last_revision does not exist causign the launcher
script to exit prematurely.

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2026-01-09 16:12:27 +01:00
Marco Trevisan (Treviño) d55f3e5c41 gtk/surface: Filter out the SNAP variables by their contents
When running in a snap context we need to filtering out all the SNAP_*
variables out there, but this is not enough, because it's also needed
to sanitize them by ensuring that no variable containing a path pointing
to a $SNAP folder is leaked there.

Otherwise we might have (for example) XDG_RUNTIME_DIRS containing a
"private" snap path, and that will be exposed to all the applications
that will be started from ghostty
2025-09-19 15:54:52 -07:00
Ken VanDine 2c6e6ad680 fix: Generate pixbuf loader cache on start if needed, fixes #6066 2025-03-04 08:50:11 -05:00
Ken VanDine 76bd002aa4 fix: [snap] Don't set GDK_PIXBUF_MODULE_FILE, it causes the icon loader 2025-02-16 23:18:16 -05:00
Ken VanDine d3623393a6 More environment handling to ensure reliability across distros 2025-02-15 07:06:40 -08:00
Ken VanDine e4cf81c2ba Clean up environment variable while launching the shell 2025-02-15 07:06:40 -08:00
Ken VanDine 7e5c57a848 Only export XDG_CONFIG_HOME and XDG_DATA_HOME if they aren't already set 2025-02-15 07:06:40 -08:00
Ken VanDine 725488e1a2 Improved environment handling to ensure the snap will work across
distros and unset all SNAP environment variables that could leak at
runtime
2025-02-15 07:06:40 -08:00
Ken VanDine 43b2e43a11 EGL fixes, ensure necessary env variables are set to isolate
dependencies from the host
2025-02-15 07:06:40 -08:00
Ken VanDine ae953b5f10 Ensure LD_LIBRARY_PATH is set appropriately 2025-02-15 07:06:40 -08:00
Ken VanDine d06d6796c5 Changed shebang in launcher script 2025-02-15 07:06:40 -08:00
Ken VanDine 2b2b3c5b3b Set source-type for launcher dir 2025-02-15 07:06:40 -08:00