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

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

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

Terminal.getNumericCapability介绍

暂无

代码示例

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

@Override
public Integer getNumericCapability(Capability capability) {
  return terminal.getNumericCapability(capability);
}

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

@Override
public Integer getNumericCapability(Capability capability) {
  return terminal.getNumericCapability(capability);
}

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

@Override
public Integer getNumericCapability(InfoCmp.Capability capability) {
  return delegate().getNumericCapability(capability);
}

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

@Override
public Integer getNumericCapability(InfoCmp.Capability capability) {
  return delegate().getNumericCapability(capability);
}

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

public Tmux(Terminal terminal, PrintStream err, Consumer<Terminal> runner) throws IOException {
  this.terminal = terminal;
  this.err = err;
  this.runner = runner;
  display = new Display(terminal, true);
  // Find terminal to use
  Integer colors = terminal.getNumericCapability(Capability.max_colors);
  term = (colors != null && colors >= 256) ? "screen-256color" : "screen";
  // Setup defaults bindings
  serverOptions.put(OPT_PREFIX, "`");
  keyMap = createKeyMap(serverOptions.get(OPT_PREFIX));
}

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

public Tmux(Terminal terminal, PrintStream err, Consumer<Terminal> runner) throws IOException {
  this.terminal = terminal;
  this.err = err;
  this.runner = runner;
  display = new Display(terminal, true);
  // Find terminal to use
  Integer colors = terminal.getNumericCapability(Capability.max_colors);
  term = (colors != null && colors >= 256) ? "screen-256color" : "screen";
  // Setup defaults bindings
  serverOptions.put(OPT_PREFIX, "`");
  keyMap = createKeyMap(serverOptions.get(OPT_PREFIX));
}

代码示例来源: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

Integer cols = terminal.getNumericCapability(Capability.max_colors);
if (cols == null || cols < 8) {
  newLines = newLines.stream().map(s -> new AttributedString(s.toString()))

相关文章