org.jline.terminal.Terminal.output()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.jline.terminal.Terminal.output()方法的一些代码示例,展示了Terminal.output()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Terminal.output()方法的具体详情如下:
包路径:org.jline.terminal.Terminal
类名称:Terminal
方法名:output

Terminal.output介绍

[英]Retrieve the output stream for this terminal. In some rare cases, there may be a need to access the terminal output stream directly. In the usual cases, use the #writer() instead.
[中]检索此终端的输出流。在一些罕见的情况下,可能需要直接访问终端输出流。在通常情况下,使用#writer()代替。

代码示例

代码示例来源:origin: apache/nifi

.signalHandler(Terminal.SignalHandler.SIG_IGN)
 .build();
final PrintStream output = new PrintStream(terminal.output(), true)) {

代码示例来源:origin: apache/karaf

@Override
public OutputStream output() {
  return terminal.output();
}

代码示例来源:origin: com.aspectran/aspectran-shell-jline

@Override
public OutputStream getOutput() {
  return terminal.output();
}

代码示例来源:origin: org.apache.karaf.shell/org.apache.karaf.shell.core

@Override
public OutputStream output() {
  return terminal.output();
}

代码示例来源:origin: com.github.fonimus/spring-boot-ssh-shell-starter

@Override
public OutputStream output() {
  return delegate().output();
}

代码示例来源:origin: com.github.fonimus/ssh-shell-starter

@Override
public OutputStream output() {
  return delegate().output();
}

代码示例来源:origin: jpos/jPOS

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());
  }
}

代码示例来源:origin: jpos/jPOS

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();
    }
  }
}

代码示例来源:origin: apache/felix

.signalHandler(Terminal.SignalHandler.SIG_IGN)
    .build();
CommandSession session = processor.createSession(terminal.input(), terminal.output(), terminal.output());
AtomicBoolean closing = new AtomicBoolean();

代码示例来源:origin: org.apache.karaf.shell/org.apache.karaf.shell.core

this.session = JaasHelper.doAs(subject, (PrivilegedAction<Session>) () -> {
  String encoding = getEncoding();
  PrintStream pout = new PrintStream(terminal.output()) {
    @Override
    public void close() {

代码示例来源:origin: apache/karaf

this.session = JaasHelper.doAs(subject, (PrivilegedAction<Session>) () -> {
  String encoding = getEncoding();
  PrintStream pout = new PrintStream(terminal.output()) {
    @Override
    public void close() {

代码示例来源:origin: apache/felix

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();
    }
  }
}

代码示例来源:origin: batfish/batfish

PrintWriter pWriter = new PrintWriter(_reader.getTerminal().output(), true);
OutputStream os = new WriterOutputStream(pWriter, StandardCharsets.UTF_8);
PrintStream ps = new PrintStream(os, true);

代码示例来源:origin: jpos/jPOS-EE

OutputStream out= term.output();
OutputStream err= out;

代码示例来源:origin: jpos/jPOS

} else if (cmd instanceof Command) {
  Terminal t = ctx.getReader().getTerminal();
  ((Command) cmd).exec (t.input(), t.output(), t.output(), args);

代码示例来源:origin: jpos/jPOS

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()

代码示例来源:origin: jpos/jPOS

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
    }
  }
}

代码示例来源:origin: apache/felix

OutputStream out = new FilterOutputStream(terminal.output()) {
  @Override
  public void close() {

代码示例来源:origin: apache/karaf

((org.jline.terminal.Terminal) terminal).output(),
      ((org.jline.terminal.Terminal) terminal).output());
} else {
  session = processor.createSession(in, out, err);

代码示例来源:origin: org.apache.karaf.shell/org.apache.karaf.shell.core

((org.jline.terminal.Terminal) terminal).output(),
      ((org.jline.terminal.Terminal) terminal).output());
} else {
  session = processor.createSession(in, out, err);

相关文章