public void init() throws Exception { terminal.init(); }
@Override public void init() throws Exception { base.init(); }
public void init() throws Exception { terminal.init(); }
@Inject public JLine2Console(History history) throws Exception { super(); TerminalFactory.configure(Type.AUTO); terminal = TerminalFactory.get(); terminal.init(); consoleReader = new ConsoleReader(System.in, System.out, terminal); consoleReader.setHistory(history); consoleReader.setHistoryEnabled(true); }
@SuppressWarnings("unused") @Substitute public static Terminal create(String ttyDevice) { Terminal t; try { t = new UnixTerminal(); t.init(); } catch (Exception e) { Log.error("Failed to construct terminal; falling back to UnsupportedTerminal", e); t = new UnsupportedTerminal(); } Log.debug("Created Terminal: ", t); return t; } }
public void run() throws Exception { reader.getTerminal().init(); printGreeting(); try { while(readExpression()) { } // run finalizers and shutdown session.close(); } finally { reader.getTerminal().restore(); } }
term.init(); ConsoleReader reader = new ConsoleReader(null, new FileInputStream(FileDescriptor.in), System.out, term); Runtime.getRuntime().addShutdownHook(new Thread(){
@Override public void start(Environment environment) throws IOException { errorPrintStream = new PrintStream(errorStream, true); String user = environment.getEnv().get(Environment.ENV_USER); if (Strings.isNullOrEmpty(user)) { user = "unknown"; } try { // Use our RemoteTerminal which does not depends on the platform. terminal = new RemoteTerminal(true); terminal.init(); } catch (Exception e) { LOGGER.warn("Error during terminal detection, falling back to unsupported terminal"); LOGGER.debug(DETAILS_MESSAGE, e); terminal = new UnsupportedTerminal(); } consoleReader = new ConsoleReader(inputStream, outputStream, terminal); // Disable jline shutdownhook to avoid exception at application shutdown jline.internal.Configuration.getString("jline.shutdownhook", "false"); consoleReader.addCompleter(new StringsCompleter(commandRegistry.getCommandList())); consoleReader.setCompletionHandler(new CandidateListCompletionHandler()); consoleReader.setPrompt(user + "@" + application.getId() + "$ "); consoleReader.setHandleUserInterrupt(false); consoleReader.setHistoryEnabled(true); ses = new SubjectAwareExecutorService(Executors.newSingleThreadExecutor()); ses.submit(this); }
@Override public void start(Environment environment) throws IOException { errorPrintStream = new PrintStream(errorStream, true); String user = environment.getEnv().get(Environment.ENV_USER); if (Strings.isNullOrEmpty(user)) { user = "unknown"; } try { // Use our RemoteTerminal which does not depends on the platform. terminal = new RemoteTerminal(true); terminal.init(); } catch (Exception e) { LOGGER.warn("Error during terminal detection, falling back to unsupported terminal"); LOGGER.debug(DETAILS_MESSAGE, e); terminal = new UnsupportedTerminal(); } consoleReader = new ConsoleReader(inputStream, outputStream, terminal); // Disable jline shutdownhook to avoid exception at application shutdown jline.internal.Configuration.getString("jline.shutdownhook", "false"); consoleReader.addCompleter(new StringsCompleter(commandRegistry.getCommandList())); consoleReader.setCompletionHandler(new CandidateListCompletionHandler()); consoleReader.setPrompt(user + "@" + application.getId() + "$ "); consoleReader.setHandleUserInterrupt(false); consoleReader.setHistoryEnabled(true); ses = new SubjectAwareExecutorService(Executors.newSingleThreadExecutor()); ses.submit(this); }
Terminal terminal = TerminalFactory.get(); try { terminal.init(); } catch (Exception e) { throw new RuntimeException("Failed to initialise terminal: ", e);
Terminal terminal = TerminalFactory.get(); try { terminal.init(); } catch (Exception e) { throw new Error("Could not initialize terminal", e);