After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 588871 - vte.Terminal.forkpty(envv) does not add the environment in envv
vte.Terminal.forkpty(envv) does not add the environment in envv
Status: RESOLVED OBSOLETE
Product: vte
Classification: Core
Component: general
0.20.x
Other All
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on: 585841
Blocks:
 
 
Reported: 2009-07-17 12:31 UTC by Michael Vogt
Modified: 2010-03-17 19:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
Patch that should fix the problem. (577 bytes, patch)
2009-10-26 16:42 UTC, Michael Vogt
needs-work Details | Review

Description Michael Vogt 2009-07-17 12:31:25 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:
Comment 1 Behdad Esfahbod 2009-10-24 01:04:08 UTC
Got patch?
Comment 2 Michael Vogt 2009-10-26 16:42:01 UTC
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.
Comment 3 Christian Persch 2009-10-26 17:45:57 UTC
+ putenv(g_strdup(envp[i]));

Why not just use g_setenv ?
Comment 4 Christian Persch 2010-01-08 17:21:33 UTC
The patch in bug 585841 deprecates this API.
Comment 5 Christian Persch 2010-03-17 19:10:51 UTC
This API is deprecated on master; closing this as OBSOLETE.