src/modules/nodewrappers/nodewrappers.js
/*
     * Open a terminal window for a specified directory.
     */
Open a terminal window for a specified directory.
Open a terminal window for a specified directory .
function open(dir) {
      if (process.platform === 'darwin') {
        var terminal = 'terminal';
        spawn('osascript', [
          '-e', 'tell application "' + terminal + '"',
          '-e', 'do script "cd ' + dir  + ' && clear"',
          '-e', 'tell application "' + terminal + '" to activate',
          '-e', 'end tell'
        ]);
      } else if (process.platform === 'linux') {
        spawn('gnome-terminal', ['--working-directory', dir]);
      } else {
        throw new Error('Opening code in terminal not supported on this OS.');
      }
    }
function open ( dir ) { if ( process . platform === 'darwin' ) { var terminal = 'terminal' ; spawn ( 'osascript' , [ '-e' , 'tell application "' + terminal + '"' , '-e' , 'do script "cd ' + dir + ' && clear"' , '-e' , 'tell application "' + terminal + '" to activate' , '-e' , 'end tell' ] ) ; } else if ( process . platform === 'linux' ) { spawn ( 'gnome-terminal' , [ '--working-directory' , dir ] ) ; } else { throw new Error ( 'Opening code in terminal not supported on this OS.' ) ; } }
Open a terminal window for a specified directory.
Open a terminal window for a specified directory .
/*
         * There should be separate behavior here for when iTerm is the
         * default terminal, but that will also require extra osascript
         * coding.
         */ //var terminal = process.env.TERM_PROGRAM || 'terminal'; /*
         * @todo: We should fall back to xterm if gnome-terminal isn't available.
         */ // Spawn a gnome-terminal session in the correct working directory.