Skip to content

snap: Cleanup more environment variable set by launcher script #6969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/apprt/gtk/Surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2374,6 +2374,9 @@ pub fn defaultTermioEnv(self: *Surface) !std.process.EnvMap {
env.remove("GDK_PIXBUF_MODULEDIR");
env.remove("GDK_PIXBUF_MODULE_FILE");
env.remove("GTK_PATH");
env.remove("XDG_CONFIG_HOME");
env.remove("XDG_CACHE_HOME");
env.remove("XDG_DATA_HOME");
Comment on lines +2377 to +2379
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is safe. User or system could set this via systemd and wouldn't the launcher script inherit those paths?

Copy link
Contributor Author

@kenvandine kenvandine Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__

I'm not sure this is safe. User or system could set this via systemd and wouldn't the launcher script inherit those paths?

I think this should be fine. If a user is setting them in their own environment, they will get set when their shell starts. It's just environment variables that are set long enough to get ghostty running, before their shell starts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't set these variables in my shell init script. I set them in systemd.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure about this, because the user may not be launching a shell, they can launch any command that could rely on these env vars, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the blocker for this PR, any feedback?

}

if (self.container.window()) |window| {
Expand Down