本文整理了Java中org.jline.terminal.Terminal.getAttributes()
方法的一些代码示例,展示了Terminal.getAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Terminal.getAttributes()
方法的具体详情如下:
包路径:org.jline.terminal.Terminal
类名称:Terminal
方法名:getAttributes
暂无
代码示例来源: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.apache.karaf.shell/org.apache.karaf.shell.core
@Override
public Attributes getAttributes() {
return terminal.getAttributes();
}
代码示例来源:origin: apache/karaf
@Override
public Attributes getAttributes() {
return terminal.getAttributes();
}
代码示例来源:origin: com.github.fonimus/spring-boot-ssh-shell-starter
@Override
public Attributes getAttributes() {
return delegate().getAttributes();
}
代码示例来源:origin: com.github.fonimus/ssh-shell-starter
@Override
public Attributes getAttributes() {
return delegate().getAttributes();
}
代码示例来源:origin: jpos/jPOS
private Terminal buildTerminal (InputStream in, OutputStream out) throws IOException {
TerminalBuilder builder = TerminalBuilder.builder();
builder.streams(in,out).system(System.in == in);
Terminal t = builder.build();
Attributes attr = t.getAttributes();
attr.getOutputFlags().addAll(
EnumSet.of(Attributes.OutputFlag.ONLCR, Attributes.OutputFlag.OPOST)
);
t.setAttributes(attr);
return t;
}
代码示例来源:origin: org.jline/jline
@Override
public Map<String, KeyMap<Binding>> defaultKeyMaps() {
Map<String, KeyMap<Binding>> keyMaps = new HashMap<>();
keyMaps.put(EMACS, emacs());
keyMaps.put(VICMD, viCmd());
keyMaps.put(VIINS, viInsertion());
keyMaps.put(MENU, menu());
keyMaps.put(VIOPP, viOpp());
keyMaps.put(VISUAL, visual());
keyMaps.put(SAFE, safe());
if (getBoolean(BIND_TTY_SPECIAL_CHARS, true)) {
Attributes attr = terminal.getAttributes();
bindConsoleChars(keyMaps.get(EMACS), attr);
bindConsoleChars(keyMaps.get(VIINS), attr);
}
// Put default
for (KeyMap<Binding> keyMap : keyMaps.values()) {
keyMap.setUnicode(new Reference(SELF_INSERT));
keyMap.setAmbiguousTimeout(getLong(AMBIGUOUS_BINDING, DEFAULT_AMBIGUOUS_BINDING));
}
// By default, link main to emacs
keyMaps.put(MAIN, keyMaps.get(EMACS));
return keyMaps;
}
代码示例来源:origin: org.jline/jline
terminal.setSize(new Size(Integer.parseInt(env.getEnv().get("COLUMNS")),
Integer.parseInt(env.getEnv().get("LINES"))));
Attributes attr = terminal.getAttributes();
for (Map.Entry<PtyMode, Integer> e : env.getPtyModes().entrySet()) {
switch (e.getKey()) {
代码示例来源:origin: org.jline/jline-remote-ssh
terminal.setSize(new Size(Integer.parseInt(env.getEnv().get("COLUMNS")),
Integer.parseInt(env.getEnv().get("LINES"))));
Attributes attr = terminal.getAttributes();
for (Map.Entry<PtyMode, Integer> e : env.getPtyModes().entrySet()) {
switch (e.getKey()) {
代码示例来源:origin: jpos/jPOS-EE
Attributes termAttrs= term.getAttributes();
termAttrs.setLocalFlag(Attributes.LocalFlag.ECHO, false);
term.setAttributes(termAttrs);
代码示例来源:origin: com.github.fonimus/spring-boot-ssh-shell-starter
resultHandler.setTerminal(terminal);
Attributes attr = terminal.getAttributes();
fill(attr, sshEnv.getPtyModes());
terminal.setAttributes(attr);
代码示例来源:origin: org.jline/jline-builtins
active = new VirtualConsole(paneId.incrementAndGet(), term, 0, 0, size.getColumns(), size.getRows() - 1, this::setDirty, this::close, layout);
active.active = lastActive++;
active.getConsole().setAttributes(terminal.getAttributes());
panes.add(active);
runner.accept(active.getConsole());
代码示例来源:origin: org.jline/jline
active = new VirtualConsole(paneId.incrementAndGet(), term, 0, 0, size.getColumns(), size.getRows() - 1, this::setDirty, this::close, layout);
active.active = lastActive++;
active.getConsole().setAttributes(terminal.getAttributes());
panes.add(active);
runner.accept(active.getConsole());
代码示例来源:origin: org.jline/jline-builtins
newConsole.getConsole().setAttributes(terminal.getAttributes());
if (!opt.isSet("d")) {
active = newConsole;
代码示例来源:origin: org.jline/jline
newConsole.getConsole().setAttributes(terminal.getAttributes());
if (!opt.isSet("d")) {
active = newConsole;
代码示例来源:origin: apache/samza
prevStatus.attributes = terminal.getAttributes();
Attributes newAttributes = new Attributes(prevStatus.attributes);
代码示例来源:origin: org.jline/jline
Attributes attributes = terminal.getAttributes();
Attributes newAttr = new Attributes(attributes);
newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
代码示例来源:origin: org.jline/jline-builtins
Attributes attributes = terminal.getAttributes();
Attributes newAttr = new Attributes(attributes);
newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
内容来源于网络,如有侵权,请联系作者删除!