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

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

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

Terminal.enterRawMode介绍

暂无

代码示例

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

  1. @Override
  2. public Attributes enterRawMode() {
  3. return terminal.enterRawMode();
  4. }

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

  1. @Override
  2. public Attributes enterRawMode() {
  3. return terminal.enterRawMode();
  4. }

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

  1. @Override
  2. public Attributes enterRawMode() {
  3. return delegate().enterRawMode();
  4. }

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

  1. @Override
  2. public Attributes enterRawMode() {
  3. return delegate().enterRawMode();
  4. }

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

  1. @Override
  2. public Object execute() throws Exception {
  3. if (arguments == null || arguments.length() == 0) {
  4. System.err.println("Argument expected");
  5. } else {
  6. WatchTask watchTask = new WatchTask();
  7. executorService.scheduleAtFixedRate(watchTask, 0, interval, TimeUnit.SECONDS);
  8. try {
  9. Terminal terminal = (Terminal) session.get(".jline.terminal");
  10. Terminal.SignalHandler prev = terminal.handle(Terminal.Signal.INT, this::abort);
  11. Attributes attr = terminal.enterRawMode();
  12. try {
  13. reading = Thread.currentThread();
  14. while (terminal.reader().read(1) == NonBlockingReader.READ_EXPIRED);
  15. } finally {
  16. reading = null;
  17. terminal.setAttributes(attr);
  18. terminal.handle(Terminal.Signal.INT, prev);
  19. }
  20. } catch (InterruptedIOException e) {
  21. // Ignore
  22. } finally {
  23. abort = true;
  24. executorService.shutdownNow();
  25. }
  26. }
  27. return null;
  28. }

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

  1. @Override
  2. public Object execute() throws Exception {
  3. if (arguments == null || arguments.length() == 0) {
  4. System.err.println("Argument expected");
  5. } else {
  6. WatchTask watchTask = new WatchTask();
  7. executorService.scheduleAtFixedRate(watchTask, 0, interval, TimeUnit.SECONDS);
  8. try {
  9. Terminal terminal = (Terminal) session.get(".jline.terminal");
  10. Terminal.SignalHandler prev = terminal.handle(Terminal.Signal.INT, this::abort);
  11. Attributes attr = terminal.enterRawMode();
  12. try {
  13. reading = Thread.currentThread();
  14. while (terminal.reader().read(1) == NonBlockingReader.READ_EXPIRED);
  15. } finally {
  16. reading = null;
  17. terminal.setAttributes(attr);
  18. terminal.handle(Terminal.Signal.INT, prev);
  19. }
  20. } catch (InterruptedIOException e) {
  21. // Ignore
  22. } finally {
  23. abort = true;
  24. executorService.shutdownNow();
  25. }
  26. }
  27. return null;
  28. }

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

  1. };
  2. executorService.scheduleAtFixedRate(task, 0, interval, TimeUnit.SECONDS);
  3. Attributes attr = terminal.enterRawMode();
  4. terminal.reader().read();
  5. terminal.setAttributes(attr);

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

  1. Attributes attr = terminal.enterRawMode();
  2. try {

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

  1. Attributes attr = terminal.enterRawMode();
  2. try {

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

  1. Attributes attr = terminal.enterRawMode();
  2. try {
  3. window = size.getRows() - 1;

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

  1. } else {
  2. final ChannelShell channel = sshSession.createShellChannel();
  3. Attributes attributes = terminal.enterRawMode();
  4. try {
  5. Map<PtyMode, Integer> modes = new HashMap<>();

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

  1. Attributes attributes = terminal.enterRawMode();
  2. try {
  3. Map<PtyMode, Integer> modes = new HashMap<>();

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

  1. } else {
  2. final ChannelShell channel = sshSession.createShellChannel();
  3. Attributes attributes = terminal.enterRawMode();
  4. try {
  5. Map<PtyMode, Integer> modes = new HashMap<>();

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

  1. final ChannelShell channel = sshSession.createShellChannel();
  2. final org.jline.terminal.Terminal terminal = (org.jline.terminal.Terminal) session.get(".jline.terminal");
  3. Attributes attributes = terminal.enterRawMode();
  4. try {
  5. Map<PtyMode, Integer> modes = new HashMap<>();

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

  1. Attributes attributes = terminal.enterRawMode();
  2. try {
  3. Map<PtyMode, Integer> modes = new HashMap<>();

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

  1. final ChannelShell channel = sshSession.createShellChannel();
  2. final org.jline.terminal.Terminal terminal = (org.jline.terminal.Terminal) session.get(".jline.terminal");
  3. Attributes attributes = terminal.enterRawMode();
  4. try {
  5. Map<PtyMode, Integer> modes = new HashMap<>();

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

  1. SignalHandler prevIntHandler = terminal.handle(Signal.INT, this::interrupt);
  2. SignalHandler prevSuspHandler = terminal.handle(Signal.TSTP, this::suspend);
  3. Attributes attributes = terminal.enterRawMode();
  4. terminal.puts(Capability.enter_ca_mode);
  5. terminal.puts(Capability.keypad_xmit);

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

  1. SignalHandler prevIntHandler = terminal.handle(Signal.INT, this::interrupt);
  2. SignalHandler prevSuspHandler = terminal.handle(Signal.TSTP, this::suspend);
  3. Attributes attributes = terminal.enterRawMode();
  4. terminal.puts(Capability.enter_ca_mode);
  5. terminal.puts(Capability.keypad_xmit);

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

  1. protected void handleSignal(Signal signal) {
  2. if (signal == Signal.WINCH) {
  3. size.copy(terminal.getSize());
  4. display.resize(size.getRows(), size.getColumns());
  5. redisplay();
  6. }
  7. else if (signal == Signal.CONT) {
  8. terminal.enterRawMode();
  9. size.copy(terminal.getSize());
  10. display.resize(size.getRows(), size.getColumns());
  11. terminal.puts(Capability.keypad_xmit);
  12. redrawLine();
  13. redisplay();
  14. }
  15. }

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

  1. previousWinchHandler = terminal.handle(Signal.WINCH, this::handleSignal);
  2. previousContHandler = terminal.handle(Signal.CONT, this::handleSignal);
  3. originalAttributes = terminal.enterRawMode();

相关文章