Beispiel #1
0
 /**
  * Returns the current window size of this PTY.
  *
  * @return a {@link WinSize} instance with information about the master side of the PTY, never
  *     <code>null</code>.
  * @throws IOException in case obtaining the window size failed.
  */
 public WinSize getWinSize() throws IOException {
   WinSize result = new WinSize();
   if (JPty.getWinSize(m_fdMaster, result) < 0) {
     throw new IOException("Failed to get window size: " + JPty.errno());
   }
   return result;
 }
Beispiel #2
0
 /**
  * Sets the current window size of this PTY.
  *
  * @param winSize the {@link WinSize} instance to set on the master side of the PTY, cannot be
  *     <code>null</code>.
  * @throws IllegalArgumentException in case the given argument was <code>null</code>.
  * @throws IOException in case obtaining the window size failed.
  */
 public void setWinSize(WinSize winSize) throws IOException {
   if (winSize == null) {
     throw new IllegalArgumentException("WinSize cannot be null!");
   }
   if (JPty.setWinSize(m_fdMaster, winSize) < 0) {
     throw new IOException("Failed to set window size: " + JPty.errno());
   }
 }
Beispiel #3
0
 /**
  * Tests whether the child-process is still alive or already terminated.
  *
  * @return <code>true</code> if the child process is still alive, <code>false</code> if it is
  *     terminated.
  */
 public boolean isChildAlive() {
   return JPty.isProcessAlive(m_childPid);
 }