.signalHandler(Terminal.SignalHandler.SIG_IGN) .build(); final PrintStream output = new PrintStream(terminal.output(), true)) {
@Override public OutputStream output() { return terminal.output(); }
@Override public OutputStream getOutput() { return terminal.output(); }
@Override public OutputStream output() { return terminal.output(); }
@Override public OutputStream output() { return delegate().output(); }
@Override public OutputStream output() { return delegate().output(); }
public CLIContext build() { if (reader != null) { if (out == null) out = reader.getTerminal().output(); if (err == null) err = out; } return new CLIContext(cli, out, err, in, reader, new LinkedHashMap()); } }
public void exec(CLIContext cli, String[] args) { try { String[] params = new String[args.length - 1]; System.arraycopy(args, 1, params, 0, params.length); PrintStream os = new PrintStream(cli.getReader().getTerminal().output()); new org.jpos.security.jceadapter.Console().exec(os,os,params); } catch (Exception e) { e.printStackTrace(); } } }
this.session = JaasHelper.doAs(subject, (PrivilegedAction<Session>) () -> { String encoding = getEncoding(); PrintStream pout = new PrintStream(terminal.output()) { @Override public void close() {
this.session = JaasHelper.doAs(subject, (PrivilegedAction<Session>) () -> { String encoding = getEncoding(); PrintStream pout = new PrintStream(terminal.output()) { @Override public void close() {
private void runShell(CommandSession session, Terminal terminal) { InputStream in = terminal.input(); OutputStream out = terminal.output(); CommandSession newSession = processor.createSession(in, out, out); newSession.put(Shell.VAR_TERMINAL, terminal); newSession.put(".tmux", session.get(".tmux")); Context context = new Context() { public String getProperty(String name) { return System.getProperty(name); } public void exit() throws Exception { terminal.close(); } }; try { new Shell(context, processor).gosh(newSession, new String[]{"--login"}); } catch (Exception e) { e.printStackTrace(); } finally { try { terminal.close(); } catch (IOException e) { e.printStackTrace(); } } }
PrintWriter pWriter = new PrintWriter(_reader.getTerminal().output(), true); OutputStream os = new WriterOutputStream(pWriter, StandardCharsets.UTF_8); PrintStream ps = new PrintStream(os, true);
OutputStream out= term.output(); OutputStream err= out;
public void exec(CLIContext cli, String[] args) throws Exception { this.p = new PrintStream(cli.getReader().getTerminal().output()); this.cli = cli; this.ansi = false; // cli.getReader().getTerminal()
public void exec(CLIContext cli, String[] args) throws Exception { this.p = new PrintStream(cli.getReader().getTerminal().output()); this.cli = cli; this.ansi = false; // cli.getReader().getTerminal().isAnsiSupported(); if (args.length == 1) { usage(cli); return; } for (int i = 1; i < args.length; i++) { try { Logger logger = (Logger) NameRegistrar.get("logger." + args[i]); logger.addListener(this); } catch (NameRegistrar.NotFoundException e) { cli.println("Logger " + args[i] + " not found -- ignored."); } } // cli.getReader().readCharacter(new char[]{'q', 'Q'}); cli.getReader().readLine(); for (int i = 1; i < args.length; i++) { try { Logger logger = (Logger) NameRegistrar.get("logger." + args[i]); logger.removeListener(this); } catch (NameRegistrar.NotFoundException ignored) { // NOPMD OK to happen } } }
OutputStream out = new FilterOutputStream(terminal.output()) { @Override public void close() {