GNOME Bugzilla – Bug 463361
gnome-terminal can change the X display it uses
Last modified: 2008-09-25 19:00:58 UTC
Please describe the problem: I have more than one X server running under my account, and more than one gnome-session running under the account, but on different displays. But in certain instances, gnome changes the DISPLAY to which I am displaying windows. This proves my point: [dcampbel@Vigor12 ~]$ export DISPLAY=unix:1000.0 [dcampbel@Vigor12 ~]$ gnome-terminal -e 'sh -c "echo $DISPLAY >/tmp/out"' [dcampbel@Vigor12 ~]$ cat /tmp/out :0.0 [dcampbel@Vigor12 ~]$ Why should it do that???? Steps to reproduce: 1. Start a gnome session 2. Start another gnome session under the same account on a different display 3. In the second gnome session run commands as above Actual results: The DISPLAY is changed Expected results: I would expect the DISPLAY to stay the same! Does this happen every time? no, but most of the time Other information:
I'm running on Fedora 7 and configuration is pretty much default in terms of gnome and X settings.
one further comment, the account .bash_profile, .bashrc and the system /etc/bashrc are completely default from installation, ie they don't set DISPLAY
Here are some instructions for reproducing this with Xvnc: 1. Do your normal gnome logon to your desktop 2. Ensure that the VNC server software is installed - on fedora this is the vnc-server-4.1.2-18.fc7 module from yum 3. Run vncpasswd under your user account to set up a vnc password 4. Run this command below to launch the vnc server, but do it from a shell outside of the context of the gnome environment, ie either flick back to text mode with CTRL-SHIFT-F1, or login remotely from another computer via ssh. Xvnc :1 -desktop Vigor12:1 -auth $HOME/.Xauthority -geometry 1024x768 -depth 24 -rfbwait 30000 -rfbauth $HOME/.vnc/passwd -rfbport 5900 -pn -nolisten tcp & 6. Then connect your vnc client to port 5900 on the server using the password you set. You should have a blank X screen visible there. 7. Back at the commandline where you started Xvnc, run this command to start gnome-session: DISPLAY=:1 gnome-session & 8. Then cancel any warnings that come up. 9. Then start a gnome-terminal. It comes up ok. 10. Then start another gnome-terminal. This one doesn't come up on vnc but goes to the main :0 display even though it was started by the vnc environment. 11. From the first gnome terminal that started you can run these commands: [dcampbel@Vigor12 ~]$ set | grep DBUS DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-6hHgZKrM2F,guid=a1ca88ad72653f6fa979500046b54d56 [dcampbel@Vigor12 ~]$ grep -l `set|grep DBUS` ~/.dbus/session-bus/* [dcampbel@Vigor12 ~]$ echo $DISPLAY :1.0 [dcampbel@Vigor12 ~]$ gnome-terminal -e 'sh -c "echo $DISPLAY >/tmp/out"' [dcampbel@Vigor12 ~]$ cat /tmp/out :0.0
I would take a guess that this is a special case of bug 98715. Environment variables are ignored when another gnome-terminal is already open.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.