if (System.getenv("INSIDE_EMACS") != null) { t = new UnsupportedTerminal(true, false); } else { t = new UnsupportedTerminal(false, true); t = new UnsupportedTerminal(); return new UnsupportedTerminal();
public UnsupportedTerminal(boolean ansiSupported, boolean echoEnabled) { super(false); setAnsiSupported(ansiSupported); setEchoEnabled(echoEnabled); } }
@Override protected Terminal createTerminal() { // unix or windows terminal have no relation at all to the behavior of an Eclipse console. return new UnsupportedTerminal(); } }
public UnsupportedTerminal() { super(false); setAnsiSupported(false); setEchoEnabled(true); } }
public StreamConsoleReader(InputStream in, PrintWriter out) { try { if ("jline.UnsupportedTerminal".equals(System.getProperty("jline.terminal"))) { jlineConsoleReader = new jline.console.ConsoleReader(in, out, new UnsupportedTerminal()); } else { jlineConsoleReader = new jline.console.ConsoleReader(in, out); } } catch (Throwable e) { logger.warn("Fail to create jline console, some features like password mask will be disabled, you might change the log level to debug to show the detailed information"); if (logger.isDebugEnabled()) { logger.debug("Fail to create jline console, some features like password mask will be disabled", e); } jlineConsoleEnabled = false; keyboard = new BufferedReader(new InputStreamReader(in)); console = out; } }
private static ConsoleReader createInteractiveConsoleReader() throws IOException { ConsoleReader reader; if(Strings.nullToEmpty(System.getProperty("os.name")).startsWith("Windows")) { // AnsiWindowsTerminal does not work properly in WIndows 7 // so disabling across the board for now reader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal()); } else { reader = new ConsoleReader(); } reader.setExpandEvents(false); // disable events triggered by "!", which is a valid R token reader.setHandleUserInterrupt(true); return reader; }
public void init() throws Exception { if ("jline.UnsupportedTerminal".equals(System.getProperty("jline.terminal"))) { term = new UnsupportedTerminal(); return; } boolean windows = System.getProperty("os.name").toLowerCase().contains("windows"); try { if (windows) { AnsiWindowsTerminal t = new AnsiWindowsTerminal(); t.setDirectConsole(true); t.initializeTerminal(); term = t; } else { NoInterruptUnixTerminal t = new NoInterruptUnixTerminal(); t.initializeTerminal(); term = t; } } catch (Throwable e) { System.out.println("Using an unsupported terminal: " + e.toString()); term = new UnsupportedTerminal(); } }
public void start() throws IOException { if(System.console() == null) { reader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal()); } else { reader = new ConsoleReader(); } do { String line = reader.readLine(environment.getPrompt()); execute(line); } while(true); }
t = new UnsupportedTerminal(); t = new UnsupportedTerminal(); return new UnsupportedTerminal();
this.sin = in; if (cmd.hasOption("B")) { this.reader = new ConsoleReader(sin, out, new UnsupportedTerminal()); } else { this.reader = new ConsoleReader(sin, out);
this.err = err; this.queue = new ArrayBlockingQueue<Integer>(1024); this.terminal = term == null ? new UnsupportedTerminal() : term; this.consoleInput = new ConsoleInputStream(); this.session = processor.createSession(this.consoleInput, this.out, this.err);
this.sin = in; if (cmd.hasOption("B")) { this.reader = new ConsoleReader(sin, out, new UnsupportedTerminal()); } else { this.reader = new ConsoleReader(sin, out);
@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; } }
@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); }