Ampersand behavior in Bash on Mac OS X Lion

1.7k Views Asked by At

I previously used bash on ubuntu 10.04 LTS as my default shell environment. Recently switched to Mac and can't seem to figure out why programs called with ampersand don't launch. I figure it is a startup script modification or environment variable, either bash var or having to do with X11 that I need to set in .profile, but I can't find any info on this.

I can open a new terminal window or tab from the menubar and say run emacs, but I'm used to being able to type:

emacs foo.txt & 

to launch emacs in it's own window. On Mac OSX Lion, I get back a stopped pid.

Alt. I gave the example with emacs, but then I tried out typing:

xterm &

and that spawns a new xterm window as expected. Is emacs (default) that comes loaded in OS X Lion configured without X support?

2

There are 2 best solutions below

5
On BEST ANSWER

OS X Lion has no X installed so you can't open standard emacs in X mode. You want to start a background process, this fails because emacs can't connect to any x server and bash prints the message, that you background process was stopped.

3
On

OS X is not a type of X environment. It is a Apple operating system built onto a BSD platform.

That being said, OS X 10.7 (Lion) is supposed to have shipped with x11 available to be installed with it. I would ask if you did an upgrade to get to Lion or a fresh install. If you did an upgrade, you might not have installed the x11 application with it that would give you access to running the x11 applications.

That would be the first place I'd check. See if there are any extras you didn't install from the Lion install disks.