public static String getInfoCmp( String terminal ) throws IOException, InterruptedException { String caps = CAPS.get(terminal); if (caps == null) { Process p = new ProcessBuilder("infocmp", terminal).start(); caps = TerminalLineSettings.waitAndCapture(p); CAPS.put(terminal, caps); } return caps; }
private String exec(final String... cmd) throws IOException, InterruptedException { checkNotNull(cmd); Log.trace("Running: ", cmd); Process p = null; if (useRedirect) { try { p = inheritInput(new ProcessBuilder(cmd)).start(); } catch (Throwable t) { useRedirect = false; } } if (p == null) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < cmd.length; i++) { if (i > 0) { sb.append(' '); } sb.append(cmd[i]); } sb.append(" < "); sb.append(ttyDevice); p = new ProcessBuilder(shCommand, "-c", sb.toString()).start(); } String result = waitAndCapture(p); Log.trace("Result: ", result); return result; }
public static String getInfoCmp( String terminal ) throws IOException, InterruptedException { String caps = CAPS.get(terminal); if (caps == null) { Process p = new ProcessBuilder("infocmp", terminal).start(); caps = TerminalLineSettings.waitAndCapture(p); CAPS.put(terminal, caps); } return caps; }
private String exec(final String... cmd) throws IOException, InterruptedException { checkNotNull(cmd); Log.trace("Running: ", cmd); Process p = null; if (useRedirect) { try { p = inheritInput(new ProcessBuilder(cmd)).start(); } catch (Throwable t) { useRedirect = false; } } if (p == null) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < cmd.length; i++) { if (i > 0) { sb.append(' '); } sb.append(cmd[i]); } sb.append(" < "); sb.append(ttyDevice); p = new ProcessBuilder(shCommand, "-c", sb.toString()).start(); } String result = waitAndCapture(p); Log.trace("Result: ", result); return result; }