Department of
Physics & Astronomy

 
Academics
Courses
Events
Research
People
Facilities

Main Page
SFSU Home
  • Computer System
    • The DISPLAY Variable

Setting the DISPLAY Environmental Variable


The Problem

Many Unix applications need to open additional windows, generally for graphics. They use the environmental variable DISPLAY to tell them on what computer to open the window. If the environmental variable is not set, you will get the following error:
      IDL> plot,indgen(100)
      % PLOT: Unable to open X Windows display: 
      	Is your DEVICE environment variable set correctly?
      	% Execution halted at $MAIN$   (PLOT).
      IDL> 
If the value of DISPLAY is set to someone else's computer, your window will pop up on their computer screen!

The Solution

The DISPLAY variable needs to be set to the IP address of your computer, followed by a screen address, which can always be taken to be :0.0 . Here are some examples corresponding to different situations.
PC in the Terminal Room
   hodge:drodman% setenv DISPLAY th123-13.sfsu.edu:0.0
The last three digits of the computer name are different for each PC in the room.
PC in Faculty Office
   hodge:bland% setenv DISPLAY ingrid.sfsu.edu:0.0
Using XWIN over PPP Modem Connection
   hodge:bland% setenv DISPLAY 130.212.200.42:0.0
The number 130.212.200.42 is the temporary IP address assigned to you when you establish a PPP connection. You can find it in the TRUMPET WINSOCK SETUP window, if you are using the WINSOCK provided by the University. It is different every time you connect.
Running from a GraphOn terminal in the Terminal Room
   hodge:bland% setenv DISPLAY unix0:0.0
Actually I am not too sure about this one. The name could be unix1, unix2, unix3, etc., and is assigned when you log on. It might be better to log directly onto the machine you are going to run on, in which case the DISPLAY variable will be set correctly by the system.
webwiz@stars.sfsu.edu