GNOME Bugzilla – Bug 588871
vte.Terminal.forkpty(envv) does not add the environment in envv
Last modified: 2010-03-17 19:10:51 UTC
Please describe the problem: When running: #!/usr/bin/python import subprocess import gtk import vte w = gtk.Window() vte = vte.Terminal() w.add(vte) w.maximize() w.show_all() pid = vte.forkpty(envv=["foo=bar"]) if pid == 0: subprocess.call(["env"]) else: gtk.main() I do not have the environment "foo=bar" added. This might be releated to bug #587894 but even with the patch there the environment is not added. Steps to reproduce: 1. Run the above test program 2. Check the output and notice the missing "foo=bar" there Actual results: No "foo=bar" in the output Expected results: foo=bar in the output of "env" Does this happen every time? Yes Other information:
Got patch?
Created attachment 146276 [details] [review] Patch that should fix the problem. It looks like env merging/adding is only done if a command is given currently. The attached patch adds it on fork_pty() as well.
+ putenv(g_strdup(envp[i])); Why not just use g_setenv ?
The patch in bug 585841 deprecates this API.
This API is deprecated on master; closing this as OBSOLETE.