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

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

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

Attributes.setLocalFlags介绍

暂无

代码示例

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

newAttributes.setLocalFlags(
    EnumSet.of(Attributes.LocalFlag.ISIG, Attributes.LocalFlag.TOSTOP), true);
newAttributes.setLocalFlags(EnumSet.of(
    Attributes.LocalFlag.ICANON, Attributes.LocalFlag.ECHO,
    Attributes.LocalFlag.IEXTEN), false);

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

public void copy(Attributes attributes) {
  setControlFlags(attributes.getControlFlags());
  setInputFlags(attributes.getInputFlags());
  setLocalFlags(attributes.getLocalFlags());
  setOutputFlags(attributes.getOutputFlags());
  setControlChars(attributes.getControlChars());
}

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

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

相关文章