Mac Opening Xterm From Unix Shell

ScKaSx

macrumors regular
Original poster
Feb 27, 2006
105
0
Hi All,

This problem is linked to several problems I've had graphing in unix. I'm not sure what to set my DISPLAY variable to in the Unix 'env' file. Currently I am using, DISPLAY=:0.0. However, this isn't working, seeing as I can't open X11 from the unix shell and I can't plot using gnuplot. Any help with this would be appreciated.

The application I'm using this for is dynamic plotting from my C program. Please help.

Cheers,
ScKaSx
 

crackpip

macrumors regular
Jul 23, 2002
210
0
ScKaSx said:
Hi All,

This problem is linked to several problems I've had graphing in unix. I'm not sure what to set my DISPLAY variable to in the Unix 'env' file. Currently I am using, DISPLAY=:0.0. However, this isn't working, seeing as I can't open X11 from the unix shell and I can't plot using gnuplot. Any help with this would be appreciated.

The application I'm using this for is dynamic plotting from my C program. Please help.

Cheers,
ScKaSx
You do have X11.app up and running, right? I have my display set at :0.0 and it works fine. You might try a couple of different X11 apps in /usr/X11R6/bin. I have had issues where certain apps would pop-up just fine, while others failed.

crackpip
 

ScKaSx

macrumors regular
Original poster
Feb 27, 2006
105
0
Yeah, I can load display graphics fine from X11. Although (and I know this is nit picky) I wanted to load xterm from the terminal window. I also want to plot mulitple graphics windows from the terminal, which it doesn't seem capable to do through gnuplot. Let me know if you have any ideas. Thanks.

Cheers,
ScKaSx
 

plinden

macrumors 68040
Apr 8, 2004
3,968
3
Typing this in Terminal works for me:
Code:
open /Applications/Utilities/X11.app/
This opens an xterm without scroll bars, which I don't like, and I usually do the above followed by:
Code:
xterm -sb -sl 1000 &
I'm not sure if this is also a problem with you, but if you're having problems displaying in X11, you could also try typing:
Code:
xhost +
 

emotion

macrumors 68040
Mar 29, 2004
3,186
3
Manchester, UK
plinden said:
Typing this in Terminal works for me:
Code:
open /Applications/Utilities/X11.app/
This opens an xterm without scroll bars, which I don't like, and I usually do the above followed by:
Code:
xterm -sb -sl 1000 &
I'm not sure if this is also a problem with you, but if you're having problems displaying in X11, you could also try typing:
Code:
xhost +
Be very careful with that one (xhost +). It's possible to remotely log your keystrokes when your display is open like that.
 

mrichmon

macrumors 6502a
Jun 17, 2003
873
2
plinden said:
Typing this in Terminal works for me:
Code:
open /Applications/Utilities/X11.app/
This opens an xterm without scroll bars, which I don't like, and I usually do the above followed by:
Code:
xterm -sb -sl 1000 &
If you don't want X11 to automatically open the default xterm window then you can comment out the xterm command from the X11 startup script. The commands started when you launch X11 are defined in the file /etc/X11/xinit/xinitrc.

If you don't want to start an xterm when X11 starts then you should scroll to the bottom of that file to find the line "xterm &" in the section labeled "start some nice programs" comment out the xterm line using a "#" character at the start of the line to stop xterm from loading when X11 starts.

If you do want xterm to start, but you want it to start with particular command line options then you can add those options to the "xterm" line in the xinitrc file. Make sure that the xterm command ends with a "&" character to run xterm in the background.

Note: xinitrc is read only and owned by root so it needs to be edited by a superuser.

Warning: Be very careful editing xinitrc since a bad command in this file will prevent X11 from starting correctly.