[sf-perl] determining console or xwindows mode

Quinn Weaver quinn at fairpath.com
Wed Mar 3 07:31:30 PST 2010

On Mar 3, 2010, at 12:34 AM, Steve Fink <sphink at gmail.com> wrote:

> On Tue, Mar 2, 2010 at 8:35 PM, David Alban <extasia at extasia.org>  
> wrote:
>> caveat:  you can be running under X and not have your $DISPLAY set.
>> not optimal, but it happens.
>> consider also checking for X11 libs and/or an X server process in the
>> process table.
> If DISPLAY is not set, then you wouldn't want to run in "X mode"
> anyway. In the first place, you probably can't, since I'm guessing "X
> mode" probably talks to the X server at some point. But even if not, I
> will sometimes intentionally unset DISPLAY in order to force things
> into text mode. (Usually because I am using SSH to port-forward some X
> client through a slow link, and I don't want my emacs processes to
> take several minutes to open up their graphical windows.)

I used to do that too. Nowadays,I just use 'emacs -nw', which has the  
same effect.

Tangent: TRAMP is a great way to run emacs graphically while  
transparently operating on remote files. However, it can be tricky to  
set up (it's supposed to be capable of traversing firewalls using  
multiple ssh hops, but this hasn't always worked for me). Also, it's  
nice for sudo-editing local files without starting a new shell and  

Quinn Weaver Consulting, LLC
Full-stack web design and development

More information about the SanFrancisco-pm mailing list