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

x33g5p2x  于2022-01-17 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(120)

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

Attributes.setControlChar介绍

暂无

代码示例

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

private Tuple2<Attributes, Map<Signal, SignalHandler>> prepareTerminal() {
  final Terminal terminal = client.getTerminal();
  final Attributes prevAttributes = terminal.getAttributes();
  // adopted from org.jline.builtins.Nano
  // see also https://en.wikibooks.org/wiki/Serial_Programming/termios#Basic_Configuration_of_a_Serial_Interface
  // no line processing
  // canonical mode off, echo off, echo newline off, extended input processing off
  Attributes newAttr = new Attributes(prevAttributes);
  newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
  // turn off input processing
  newAttr.setInputFlags(EnumSet.of(Attributes.InputFlag.IXON, Attributes.InputFlag.ICRNL, Attributes.InputFlag.INLCR), false);
  // one input byte is enough to return from read, inter-character timer off
  newAttr.setControlChar(Attributes.ControlChar.VMIN, 1);
  newAttr.setControlChar(Attributes.ControlChar.VTIME, 0);
  newAttr.setControlChar(Attributes.ControlChar.VINTR, 0);
  terminal.setAttributes(newAttr);
  final Map<Signal, SignalHandler> prevSignals = new HashMap<>();
  prevSignals.put(Signal.WINCH, terminal.handle(Signal.WINCH, this::handleSignal));
  prevSignals.put(Signal.INT, terminal.handle(Signal.INT, this::handleSignal));
  prevSignals.put(Signal.QUIT, terminal.handle(Signal.QUIT, this::handleSignal));
  return Tuple2.of(prevAttributes, prevSignals);
}

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

public Attributes enterRawMode() {
  Attributes prvAttr = getAttributes();
  Attributes newAttr = new Attributes(prvAttr);
  newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
  newAttr.setInputFlags(EnumSet.of(InputFlag.IXON, InputFlag.ICRNL, InputFlag.INLCR), false);
  newAttr.setControlChar(ControlChar.VMIN, 0);
  newAttr.setControlChar(ControlChar.VTIME, 1);
  setAttributes(newAttr);
  return prvAttr;
}

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

switch (e.getKey()) {
case VINTR:
  attr.setControlChar(Attributes.ControlChar.VINTR, e.getValue());
  break;
case VQUIT:
  attr.setControlChar(Attributes.ControlChar.VQUIT, e.getValue());
  break;
case VERASE:
  attr.setControlChar(Attributes.ControlChar.VERASE, e.getValue());
  break;
case VKILL:
  attr.setControlChar(Attributes.ControlChar.VKILL, e.getValue());
  break;
case VEOF:
  attr.setControlChar(Attributes.ControlChar.VEOF, e.getValue());
  break;
case VEOL:
  attr.setControlChar(Attributes.ControlChar.VEOL, e.getValue());
  break;
case VEOL2:
  attr.setControlChar(Attributes.ControlChar.VEOL2, e.getValue());
  break;
case VSTART:
  attr.setControlChar(Attributes.ControlChar.VSTART, e.getValue());
  break;
case VSTOP:
  attr.setControlChar(Attributes.ControlChar.VSTOP, e.getValue());
  break;
case VSUSP:

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

private void setNonBlocking() {
    if (current == null
        || current.getControlChar(Attributes.ControlChar.VMIN) != 0
        || current.getControlChar(Attributes.ControlChar.VTIME) != 1) {
      try {
        Attributes attr = getAttr();
        attr.setControlChar(Attributes.ControlChar.VMIN, 0);
        attr.setControlChar(Attributes.ControlChar.VTIME, 1);
        setAttr(attr);
      } catch (IOException e) {
        throw new IOError(e);
      }
    }
  }
}

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

switch (e.getKey()) {
  case VINTR:
    attributes.setControlChar(ControlChar.VINTR, e.getValue());
    break;
  case VQUIT:
    attributes.setControlChar(ControlChar.VQUIT, e.getValue());
    break;
  case VERASE:
    attributes.setControlChar(ControlChar.VERASE, e.getValue());
    break;
  case VKILL:
    attributes.setControlChar(ControlChar.VKILL, e.getValue());
    break;
  case VEOF:
    attributes.setControlChar(ControlChar.VEOF, e.getValue());
    break;
  case VEOL:
    attributes.setControlChar(ControlChar.VEOL, e.getValue());
    break;
  case VEOL2:
    attributes.setControlChar(ControlChar.VEOL2, e.getValue());
    break;
  case VSTART:
    attributes.setControlChar(ControlChar.VSTART, e.getValue());
    break;
  case VSTOP:
    attributes.setControlChar(ControlChar.VSTOP, e.getValue());
    break;
  case VSUSP:

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

switch (e.getKey()) {
  case VINTR:
    attributes.setControlChar(ControlChar.VINTR, e.getValue());
    break;
  case VQUIT:
    attributes.setControlChar(ControlChar.VQUIT, e.getValue());
    break;
  case VERASE:
    attributes.setControlChar(ControlChar.VERASE, e.getValue());
    break;
  case VKILL:
    attributes.setControlChar(ControlChar.VKILL, e.getValue());
    break;
  case VEOF:
    attributes.setControlChar(ControlChar.VEOF, e.getValue());
    break;
  case VEOL:
    attributes.setControlChar(ControlChar.VEOL, e.getValue());
    break;
  case VEOL2:
    attributes.setControlChar(ControlChar.VEOL2, e.getValue());
    break;
  case VSTART:
    attributes.setControlChar(ControlChar.VSTART, e.getValue());
    break;
  case VSTOP:
    attributes.setControlChar(ControlChar.VSTOP, e.getValue());
    break;
  case VSUSP:

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

this.writer = new PrintWriter(new OutputStreamWriter(output, encoding()));
this.attributes = new Attributes();
this.attributes.setControlChar(ControlChar.VERASE,  (char) 127);
this.attributes.setControlChar(ControlChar.VWERASE, (char) 23);
this.attributes.setControlChar(ControlChar.VKILL,   (char) 21);
this.attributes.setControlChar(ControlChar.VLNEXT,  (char) 22);
this.size = new Size();
parseInfoCmp();

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

switch (e.getKey()) {
  case VINTR:
    attr.setControlChar(ControlChar.VINTR, e.getValue());
    break;
  case VQUIT:
    attr.setControlChar(ControlChar.VQUIT, e.getValue());
    break;
  case VERASE:
    attr.setControlChar(ControlChar.VERASE, e.getValue());
    break;
  case VKILL:
    attr.setControlChar(ControlChar.VKILL, e.getValue());
    break;
  case VEOF:
    attr.setControlChar(ControlChar.VEOF, e.getValue());
    break;
  case VEOL:
    attr.setControlChar(ControlChar.VEOL, e.getValue());
    break;
  case VEOL2:
    attr.setControlChar(ControlChar.VEOL2, e.getValue());
    break;
  case VSTART:
    attr.setControlChar(ControlChar.VSTART, e.getValue());
    break;
  case VSTOP:
    attr.setControlChar(ControlChar.VSTOP, e.getValue());
    break;
  case VSUSP:

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

switch (e.getKey()) {
  case VINTR:
    attr.setControlChar(ControlChar.VINTR, e.getValue());
    break;
  case VQUIT:
    attr.setControlChar(ControlChar.VQUIT, e.getValue());
    break;
  case VERASE:
    attr.setControlChar(ControlChar.VERASE, e.getValue());
    break;
  case VKILL:
    attr.setControlChar(ControlChar.VKILL, e.getValue());
    break;
  case VEOF:
    attr.setControlChar(ControlChar.VEOF, e.getValue());
    break;
  case VEOL:
    attr.setControlChar(ControlChar.VEOL, e.getValue());
    break;
  case VEOL2:
    attr.setControlChar(ControlChar.VEOL2, e.getValue());
    break;
  case VSTART:
    attr.setControlChar(ControlChar.VSTART, e.getValue());
    break;
  case VSTOP:
    attr.setControlChar(ControlChar.VSTOP, e.getValue());
    break;
  case VSUSP:

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

attributes.setControlChar(Attributes.ControlChar.VINTR, ctrl('C'));
attributes.setControlChar(Attributes.ControlChar.VEOF,  ctrl('D'));
attributes.setControlChar(Attributes.ControlChar.VSUSP, ctrl('Z'));

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

attributes.setControlChar(cchar, parseControlChar(matcher.group(1).toUpperCase()));

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

newAttributes.setControlChar(Attributes.ControlChar.VINTR, 0);
newAttributes.setControlChar(Attributes.ControlChar.VMIN, 1);
newAttributes.setControlChar(Attributes.ControlChar.VTIME, 0);

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

newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
newAttr.setInputFlags(EnumSet.of(InputFlag.IXON, InputFlag.ICRNL, InputFlag.INLCR), false);
newAttr.setControlChar(ControlChar.VMIN, 1);
newAttr.setControlChar(ControlChar.VTIME, 0);
newAttr.setControlChar(ControlChar.VINTR, 0);
terminal.setAttributes(newAttr);
terminal.puts(Capability.enter_ca_mode);

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

newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
newAttr.setInputFlags(EnumSet.of(InputFlag.IXON, InputFlag.ICRNL, InputFlag.INLCR), false);
newAttr.setControlChar(ControlChar.VMIN, 1);
newAttr.setControlChar(ControlChar.VTIME, 0);
newAttr.setControlChar(ControlChar.VINTR, 0);
terminal.setAttributes(newAttr);
terminal.puts(Capability.enter_ca_mode);

相关文章