Create the {@link Terminal}.
961622
@VisibleForTesting
  protected Terminal createTerminal(final Branding branding) throws Exception {
    return TerminalBuilder.builder()
      .name(branding.getProgramName())
      .system(true)
      .nativeSignals(true)
      .signalHandler(Terminal.SignalHandler.SIG_IGN) // ignore signals by default
      .build();
  }
663518
function Terminal(file, args, opt) {
  if (!(this instanceof Terminal)) {
    return new Terminal(file, args, opt);
  }

  var self = this
    , env
    , cwd
    , name
    , cols
    , rows
    , uid
    , gid
    , term;

  // backward compatibility
  if (typeof args === 'string') {
    opt = {
      name: arguments[1],
      cols: arguments[2],
      rows: arguments[3],
      cwd: process.env.HOME
    };
    args = [];
  }

  // for 'close'
  this._internalee = new EventEmitter;

  // arguments
  args = args || [];
  file = file || 'sh';
  opt = opt || {};

  cols = opt.cols || 80;
  rows = opt.rows || 24;

  uid = opt.uid != null ? opt.uid : -1;
  gid = opt.gid != null ? opt.gid : -1;

  opt.env = opt.env || process.env;
  env = extend({}, opt.env);

  if (opt.env === process.env) {
    // Make sure we didn't start our
    // server from inside tmux.
    delete env.TMUX;
    delete env.TMUX_PANE;

    // Make sure we didn't start
    // our server from inside screen.
    // http://web.mit.edu/gnu/doc/html/screen_20.html
    delete env.STY;
    delete env.WINDOW;

    // Delete some variables that
    // might confuse our terminal.
    delete env.WINDOWID;
    delete env.TERMCAP;
    delete env.COLUMNS;
    delete env.LINES;
  }

  // Could set some basic env vars
  // here, if they do not exist:
  // USER, SHELL, HOME, LOGNAME, WINDOWID

  cwd = opt.cwd || process.cwd();
  name = opt.name || env.TERM || 'xterm';
  env.TERM = name;
  // XXX Shouldn't be necessary:
  // env.LINES = rows + '';
  // env.COLUMNS = cols + '';

  env = environ(env);

  function onexit(code, signal) {
    // XXX Sometimes a data event is emitted
    // after exit. Wait til socket is destroyed.
    if (!self._emittedClose) {
      if (self._boundClose) return;
      self._boundClose = true;
      self.once('close', function() {
        self.emit('exit', code, signal);
      });
      return;
    }
    self.emit('exit', code, signal);
  }

  // fork
  term = pty.fork(file, args, env, cwd, cols, rows, uid, gid, onexit);

  this.socket = TTYStream(term.fd);
  this.socket.setEncoding('utf8');

  if (opt.resume !== false) {
    this.socket.resume();
  }

  // setup
  this.socket.on('error', function(err) {
    // NOTE: fs.ReadStream gets EAGAIN twice at first:
    if (err.code) {
      if (~err.code.indexOf('EAGAIN')) return;
    }

    // close
    self._close();
    // EIO on exit from fs.ReadStream:
    if (!self._emittedClose) {
      self._emittedClose = true;
      Terminal.total--;
      self.emit('close');
    }

    // EIO, happens when someone closes our child
    // process: the only process in the terminal.
    // node < 0.6.14: errno 5
    // node >= 0.6.14: read EIO
    if (err.code) {
      if (~err.code.indexOf('errno 5')
          || ~err.code.indexOf('EIO')) return;
    }

    // throw anything else
    if (self.listeners('error').length < 2) {
      throw err;
    }
  });

  this.pid = term.pid;
  this.fd = term.fd;
  this.pty = term.pty;

  this.file = file;
  this.name = name;
  this.cols = cols;
  this.rows = rows;

  this.readable = true;
  this.writable = true;

  Terminal.total++;

  this.socket.on('close', function() {
    if (self._emittedClose) return;
    self._emittedClose = true;
    Terminal.total--;
    self._close();
    self.emit('close');
  });

  env = null;
}
327450
private void showHelp(final Terminal terminal) {
		showMessage(terminal, "/message.txt");
		commands.stream().filter(c -> !c.isHidden()).forEach(c -> c.showHelp(terminal));
	}
114596
@Override
	public void showHelp(final Terminal terminal) {
		terminal.writer().println("\t" + this.toString() + ": generate sql to access the table.");
		terminal.writer().println(
				"\t\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to keywords.");
	}
405706
public static IOSafeTerminal createRuntimeExceptionConvertingAdapter(Terminal terminal) {
        if (terminal instanceof ExtendedTerminal) { // also handle Runtime-type:
            return createRuntimeExceptionConvertingAdapter((ExtendedTerminal)terminal);
        } else {
            return new IOSafeTerminalAdapter(terminal, new ConvertToRuntimeException());
        }
    }
1354521
private void createOutputFile() throws IOException {
        this.fileChannel = Files.newByteChannel(Paths.get(filePath), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
    }
684933
def generate(env):
    """"""
    SCons.Tool.CreateJarBuilder(env)

    SCons.Tool.CreateJavaFileBuilder(env)
    SCons.Tool.CreateJavaClassFileBuilder(env)
    SCons.Tool.CreateJavaClassDirBuilder(env)

    env.AddMethod(Jar)

    env['JAR']        = 'jar'
    env['JARFLAGS']   = SCons.Util.CLVar('cf')
    env['_JARFLAGS']  = jarFlags
    env['_JARMANIFEST'] = jarManifest
    env['_JARSOURCES'] = jarSources
    env['_JARCOM']    = '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES'
    env['JARCOM']     = "${TEMPFILE('$_JARCOM','$JARCOMSTR')}"
    env['JARSUFFIX']  = '.jar'
1251630
public static BartenderFileSystem 
  createAndAddSystem()
  {
    SystemManager system = preCreate(BartenderFileSystem.class);

    BartenderFileSystem barSystem = new BartenderFileSystem();
    
    system.addSystem(BartenderFileSystem.class, barSystem);
    
    return barSystem;
  }
892348
public static Terminal get(Terminal terminal) throws Exception {
        if (terminal == null) {
            return get(TerminalFactory.get(), false);
        } else {
            return get(terminal, true);
        }
    }
878528
public void createWithDepth(int allowableDepth, TreeGP manager, TGPInitializationStrategy initializationStrategy){

      final int constantCount = manager.getConstants().size();
      for(int i=0; i < constantCount; ++i){
         constantSet.add(new Terminal("c" + i, manager.constant(i), manager.constantText(i), true), manager.constantWeight(i));
      }

      final int registerCount = manager.getVariableCount();
      for(int i=0; i < registerCount; ++i) {
         variableSet.add(new Terminal("v" + i, 0.0, "", false), 1.0);
      }

      final int operatorCount = manager.getOperatorSet().size();
      for(int i=0; i < operatorCount; ++i) {
         Primitive operator = manager.getOperatorSet().get(i);
         operatorSet.add(operator, manager.getOperatorSet().getWeight(i));
      }

      root = TreeGenerator.createWithDepth(this, allowableDepth, manager, initializationStrategy);
      calcLength();
      calcDepth();
   }
1180114
private Commandline _createCommandLine ()
  {
    /*
     * NOTE: This method is designed to work with plexus-utils:1.1 which is used
     * by all Maven versions before 2.0.6 regardless of our plugin dependency.
     * Therefore, we use setWorkingDirectory(String) rather than
     * setWorkingDirectory(File) and addArguments() rather than createArg().
     */

    final Commandline cli = new Commandline ();

    cli.setExecutable (this.executable);

    if (this.workingDirectory != null)
    {
      cli.setWorkingDirectory (this.workingDirectory.getAbsolutePath ());
    }

    final String classPath = _getClassPath ();
    if (classPath != null && classPath.length () > 0)
    {
      cli.addArguments (new String [] { "-cp", classPath });
    }

    if (this.mainClass != null && this.mainClass.length () > 0)
    {
      cli.addArguments (new String [] { this.mainClass });
    }

    cli.addArguments (_getArguments ());

    return cli;
  }
1075125
@Override
    public ConsoleEditor create(String flavor, Terminal terminal, InputStream in, PrintStream out) throws EditorInitializationException {
        if (flavorMap.containsKey(flavor)) {
            Class<? extends ConsoleEditor> editorClass = flavorMap.get(flavor);
            try {
                return instantiate(editorClass, terminal, in, out);
            } catch (Exception e) {
                throw new EditorInitializationException("Failed to create Editor instance of class:" + editorClass.getName(), e);
            }
        } else {
            Class<? extends ConsoleEditor> editorClass = resolve(flavor);
            if (editorClass != null) {
                flavorMap.put(flavor, editorClass);
                return create(flavor, terminal);
            } else {
                throw new EditorInitializationException("Unknown flavor:" + flavor);
            }
        }
    }
185118
@SuppressWarnings("static-method")
	protected OutputConfiguration createStandardOutputConfiguration() {
		final OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
		defaultOutput.setDescription(Messages.SarlOutputConfigurationProvider_0);
		defaultOutput.setOutputDirectory(SARLConfig.FOLDER_SOURCE_GENERATED);
		defaultOutput.setOverrideExistingResources(true);
		defaultOutput.setCreateOutputDirectory(true);
		defaultOutput.setCanClearOutputDirectory(false);
		defaultOutput.setCleanUpDerivedResources(true);
		defaultOutput.setSetDerivedProperty(true);
		defaultOutput.setKeepLocalHistory(false);
		return defaultOutput;
	}
974518
function(terminalConfig) {

   	var klass = WireIt.terminalClassFromXtype(terminalConfig.xtype);

      // Instanciate the terminal
      var term = new klass(this.el, terminalConfig, this);
   
      // Add the terminal to the list
      this.terminals.push( term );
   
      // Event listeners
      term.eventAddWire.subscribe(this.onAddWire, this, true);
      term.eventRemoveWire.subscribe(this.onRemoveWire, this, true);
   
      return term;
   }
1126493
private void execute() throws Exception {
		try (Terminal terminal = TerminalBuilder.builder().build()) {
			showHelp(terminal);
			showProps(terminal);

			initialize(terminal);

			listen(terminal);

			dispose(terminal);
		}
	}
668364
private void createUI() {
		add(new WHeading(HeadingLevel.H2, "Contacts"));
		add(repeater);
		createButtonBar();
		createAddContactSubForm();
		createPrintContactsSubForm();
	}
981913
def _create_application(self):
        
        # Create Application.
        application = Application(
            input=self.input,
            output=self.output,
            editing_mode=EditingMode.VI,
            layout=self.editor_layout.layout,
            key_bindings=self.key_bindings,
#            get_title=lambda: get_terminal_title(self),
            style=DynamicStyle(lambda: self.current_style),
            paste_mode=Condition(lambda: self.paste_mode),
#            ignore_case=Condition(lambda: self.ignore_case),  # TODO
            include_default_pygments_style=False,
            mouse_support=Condition(lambda: self.enable_mouse_support),
            full_screen=True,
            enable_page_navigation_bindings=True)

        # Handle command line previews.
        # (e.g. when typing ':colorscheme blue', it should already show the
        # preview before pressing enter.)
        def preview(_):
            if self.application.layout.has_focus(self.command_buffer):
                self.previewer.preview(self.command_buffer.text)
        self.command_buffer.on_text_changed += preview

        return application