Exit XWindows cleanly from console mode

Nov 17, '01 05:30:32PM

Contributed by: cmccarthy

If you use the XDarwin implementation of the X Windows system from console mode (logging in as >console and bypassing Quartz), you might notice that (on my machine at least) exiting X gives you a blank screen and a spinning rainbow cursor. The computer looks frozen, but in fact is still accepting input: typing "exit" or "logout" at this point will bring you back to the login window after a brief pause.

If you find this a little less than smooth, as I do, you can preface your "startx" command line with the "exec" command like this:

exec startx [X startup options ...]
This little UNIX trick starts X while ending your logon shell, instead of just running X as a child process of your shell. The upshot is that when you exit X, you're immediately returned to the login window, instead of having to type unechoed characters to a beachball. A minor tip, to be sure, but it makes running X from the console a little more elegant.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20011117173032750