Opened 10 years ago

Closed 10 years ago

#42852 closed defect (invalid)

MacPorts installation sets $DISPLAY=:0 in .bashrc

Reported by: pucicu (Norbert Marwan) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.2.1
Keywords: Cc:
Port:

Description

After installing MacPorts I found a new line in .bashrc setting the $DISPLAY variable to :0. This is highly problematic because the Xorg server sometimes creates a new display port (e.g. :1). In this case, X applications will not be able to work because the DISPLAY was set to :0 and an annoying "unable to open display at :0" error appears. MacPort should not set the DISPLAY variable to :0. If it is necessary to set it then the port needs to be set dynamically, depending on the used display port of the currently running X server.

Change History (4)

comment:1 Changed 10 years ago by pucicu (Norbert Marwan)

I need to correct me, it is not .bashrc but .bash_profile.

comment:2 Changed 10 years ago by neverpanic (Clemens Lang)

It seems there is indeed some code that adds a DISPLAY variable, but it should only be run on Tiger and below. Are you using Tiger? If not, what does sw_vers -productVersion | awk -F . '{print $2}' echo on your system?

Relevant code is source:trunk/base/portmgr/dmg/postflight?marks=268-273#L260.

comment:3 Changed 10 years ago by pucicu (Norbert Marwan)

Thanks for the reply and clarification. I have used Tiger for long time and also used MacPorts then. Since two years I'm using Lion/ Mavericks. But I have got this problem only quite recently and took me some time to figure out what was the problem. I could not recognise which version of MacPorts caused the modification of .bash_profile. Good to know that this is not an issue anymore. The ticket can then be closed.

comment:4 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: X installation removed
Resolution: invalid
Status: newclosed

Right, base only adds the DISPLAY variable if you're on Tiger, and you haven't already set DISPLAY yourself. If on Leopard or later, or if you've already set DISPLAY, MacPorts won't modify it.

Note: See TracTickets for help on using tickets.