protected int getTermWidth() { return terminal != null ? terminal.getWidth() : 80; }
@Override public String getType() { return terminal.getType(); }
session.put(Session.COMPLETION_MODE, loadCompletionMode()); session.put("USER", ShellUtil.getCurrentUserName()); session.put("TERM", terminal.getType()); session.put("APPLICATION", System.getProperty("karaf.name", "root")); session.put("#LINES", (Function) (session, arguments) -> Integer.toString(terminal.getHeight())); session.put("#COLUMNS", (Function) (session, arguments) -> Integer.toString(terminal.getWidth())); session.put("pid", getPid()); session.put(Shell.VAR_COMPLETIONS, new HashMap<>());
public KarafTerminal(Terminal terminal) throws IOException { super("Karaf", terminal.getType()); this.terminal = terminal; String type = terminal.getType(); if (type == null && terminal.isAnsiSupported()) { type = "ansi"; } String caps; try { caps = InfoCmp.getInfoCmp(type); } catch (Exception e) { try { caps = InfoCmp.getInfoCmp("ansi"); } catch (InterruptedException e2) { throw new UnsupportedOperationException(e2); } } try { InfoCmp.parseInfoCmp(caps, bools, ints, strings); } catch (Exception e) { // TODO } }
@Override public int getHeight() { return terminal.getHeight(); }
@Override public boolean isAnsiSupported() { return terminal.isAnsiSupported(); }
@Override public boolean isEchoEnabled() { return terminal.isEchoEnabled(); }
session.put(Session.COMPLETION_MODE, loadCompletionMode()); session.put("USER", ShellUtil.getCurrentUserName()); session.put("TERM", terminal.getType()); session.put("APPLICATION", System.getProperty("karaf.name", "root")); session.put("#LINES", (Function) (session, arguments) -> Integer.toString(terminal.getHeight())); session.put("#COLUMNS", (Function) (session, arguments) -> Integer.toString(terminal.getWidth())); session.put("pid", getPid()); session.put(Shell.VAR_COMPLETIONS, new HashMap<>());
public KarafTerminal(Terminal terminal) throws IOException { super("Karaf", terminal.getType()); this.terminal = terminal; String type = terminal.getType(); if (type == null && terminal.isAnsiSupported()) { type = "ansi"; } String caps; try { caps = InfoCmp.getInfoCmp(type); } catch (Exception e) { try { caps = InfoCmp.getInfoCmp("ansi"); } catch (InterruptedException e2) { throw new UnsupportedOperationException(e2); } } try { InfoCmp.parseInfoCmp(caps, bools, ints, strings); } catch (Exception e) { // TODO } }
@Override public int getHeight() { return terminal.getHeight(); }
@Override public boolean isAnsiSupported() { return terminal.isAnsiSupported(); }
@Override public boolean isEchoEnabled() { return terminal.isEchoEnabled(); }
@Override public int getWidth() { return terminal.getWidth(); }
private int getTermHeight() { Terminal term = session.getTerminal(); return term != null ? term.getHeight() : 25; }
@Override public String getType() { return terminal.getType(); }
@Override public int getWidth() { return terminal.getWidth(); }
private int getTermHeight() { Terminal term = session.getTerminal(); return term != null ? term.getHeight() : 25; }
channel.setPtyLines(getTermHeight()); channel.setAgentForwarding(true); channel.setEnv("TERM", session.getTerminal().getType()); String ctype = (String) session.get("LC_CTYPE"); if (ctype == null) {