Open mgkuhn opened 2 years ago
This seems caused by src/Gtk.jl:init() setting these environment variables globally
There aren't many ways to have local environment variables. That's how they are. They aren't even thread-safe. There is addenv
, but that's only for spawning processes, not calling into libraries.
One (ugly) workaround would be for Gtk.jl to provide to users a list of environment variables that it modified, along with their original values, such that users can restore their values with withenv
before calling another application.
Something like
GTK_ORIG_ENV = ["GDK_PIXBUF_MODULE_FILE" => nothing, ...]
to be used like
withenv(GTK_ORIG_ENV...) do ; run(`emacs`) ; end;
To implement this, __init__()
could first write its changes into a local dictionary NEW_ENV
and the (to be added) loop that then applies all the changes collected in NEW_ENV
to ENV
could at the same time also produce a backup of the changed environment variables in GTK_ORIG_ENV
. (Or does Julia already keep somewhere a read-only copy of the original environment variables it was called with?)
Simply loading Gtk.jl causes emacs invoked from the REPL shell mode to no longer work (Ubuntu Linux 20.04 with X11):
This seems caused by src/Gtk.jl:init() setting these environment variables globally
which overrides the system-wide default, which Ubuntu-packaged applications, such as emacs, require. To demonstrate the cause: simply deleting
GDK_PIXBUF_MODULE_FILE
fromENV
causes emacs to work again:Is there no other way to pass these parameters to GDK, one that will not also affect every other GDK application called from within Julia?