This is just a wrapper around spawn to launch commands in an X terminal: runInXTerm will check the for the XTERMCMD environmental variable, and use it to run the command. If the variable is not set the command will be executed with xterm.