Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!midway!gargoyle!igloo!ddsw1!olsa99!rascal!theo From: theo@rascal.UUCP (T. Kramer) Newsgroups: comp.windows.x Subject: Re: UNIX/X-windows questions Message-ID: <1441@rascal.UUCP> Date: 14 Jan 91 17:37:28 GMT References: <139@bwilab3.UUCP> Reply-To: theo@rascal.UUCP (T. Kramer) Organization: Rascal Systems Lines: 25 In article <139@bwilab3.UUCP> chris@bwilab3.UUCP (Chris Curtin) writes: > > >I have two simple questions, both of which deal with X windows. (One has >to do with UNIX enviornment variables, so the cross post). > >Now the X question: > >Is there a call to see if we are in X? I would rather not do a simple call >and see if it fails since this is a hack and doesn't look too good. > How about setting an environment variable eg. TERM=xterm for the X logins and TERM=vt100 for character based terminal logins. You of course have to know which tty lines support X terminals and which do not. Then using the following on startup if (!strcmp("xterm",getenv("TERM"))) XtInitialise(); /* Xt Intrinsic call */ else initscr(); /* Curses call */ +------------------------------+--------------------------------------------+ | theo@rascal | You should have seen my EX screen manager! | +------------------------------+--------------------------------------------+