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

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

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

Terminal.getType介绍

暂无

代码示例

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

@Override
public String getType() {
  return terminal.getType();
}

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

@Override
public String getType() {
  return terminal.getType();
}

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

@Override
public String getType() {
  return delegate().getType();
}

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

@Override
public String getType() {
  return delegate().getType();
}

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

public void exec(CLIContext cli, String[] args) throws Exception {
    Terminal term = cli.getReader().getTerminal();
    cli.println("TERM=" + term.getClass().getSimpleName() + "/" + term.getType());
  }
}

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

/**
 * Create a new renderer
 * @param vertx the current Vert.x instance
 * @return the renderer
 */
public static ImportProgressRenderer create(Vertx vertx) {
 // get capabilities of the terminal
 int terminalWidth;
 boolean dumb;
 try (Terminal terminal = TerminalBuilder.terminal()) {
  terminalWidth = terminal.getWidth();
  dumb = Terminal.TYPE_DUMB.equalsIgnoreCase(terminal.getType()) ||
   Terminal.TYPE_DUMB_COLOR.equalsIgnoreCase(terminal.getType());
 } catch (IOException e) {
  terminalWidth = DEFAULT_TERMINAL_WIDTH;
  dumb = true;
 }
 if (terminalWidth < MIN_TERMINAL_WIDTH) {
  terminalWidth = DEFAULT_TERMINAL_WIDTH;
 }
 // determine refresh interval
 long interval;
 if (dumb) {
  interval = DEFAULT_INTERVAL_SLOW;
 } else {
  interval = DEFAULT_INTERVAL;
 }
 // create renderer
 return new ImportProgressRenderer(interval, terminalWidth, vertx);
}

代码示例来源:origin: org.jline/jline

public String toAnsi(Terminal terminal) {
  if (terminal != null && Terminal.TYPE_DUMB.equals(terminal.getType())) {
    return toString();
  }
  int colors = 256;
  boolean force256colors = false;
  String alternateIn = null, alternateOut = null;
  if (terminal != null) {
    Integer max_colors = terminal.getNumericCapability(Capability.max_colors);
    if (max_colors != null) {
      colors = max_colors;
    }
    force256colors = AbstractWindowsTerminal.TYPE_WINDOWS_256_COLOR.equals(terminal.getType());
    if (!DISABLE_ALTERNATE_CHARSET) {
      alternateIn = Curses.tputs(terminal.getStringCapability(Capability.enter_alt_charset_mode));
      alternateOut = Curses.tputs(terminal.getStringCapability(Capability.exit_alt_charset_mode));
    }
  }
  return toAnsi(colors, force256colors, alternateIn, alternateOut);
}

代码示例来源:origin: org.jline/jline

channel.setPtyLines(terminal.getHeight());
channel.setAgentForwarding(true);
channel.setEnv("TERM", terminal.getType());

代码示例来源:origin: org.jline/jline-remote-ssh

channel.setPtyLines(terminal.getHeight());
channel.setAgentForwarding(true);
channel.setEnv("TERM", terminal.getType());

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

channel.setPtyLines(terminal.getHeight());
channel.setAgentForwarding(true);
channel.setEnv("TERM", terminal.getType());
String ctype = System.getenv("LC_CTYPE");
if (ctype == null) {

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

channel.setPtyLines(terminal.getHeight());
channel.setAgentForwarding(true);
channel.setEnv("TERM", terminal.getType());
String ctype = System.getenv("LC_CTYPE");
if (ctype == null) {

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

session.put(Shell.VAR_PROCESSOR, processor);
session.put(Shell.VAR_SESSION, session);
session.put("#TERM", (Function) (s, arguments) -> terminal.getType());
session.put("#COLUMNS", (Function) (s, arguments) -> terminal.getWidth());
session.put("#LINES", (Function) (s, arguments) -> terminal.getHeight());

代码示例来源:origin: org.jline/jline

SignalHandler previousContHandler = null;
Attributes originalAttributes = null;
boolean dumb = Terminal.TYPE_DUMB.equals(terminal.getType())
      || Terminal.TYPE_DUMB_COLOR.equals(terminal.getType());
try {

相关文章