public class POSIXTerminal extends AbstractTerminal
settings
Constructor and Description |
---|
POSIXTerminal() |
Modifier and Type | Method and Description |
---|---|
void |
changeOutputStream(PrintStream output)
During runtime, change the output stream
|
void |
close() |
PrintStream |
err()
Returns the
PrintStream associated with the std err |
TerminalSize |
getSize() |
boolean |
hasInput()
Check if the terminal has input waiting to be read.
|
void |
init(Settings settings)
Initialize the Terminal with which input/output stream it should use
|
boolean |
isEchoEnabled() |
PrintStream |
out()
Returns the
PrintStream associated with the std out |
int[] |
read()
Read from the input stream (char by char)
|
void |
reset()
Set it back to normal when we exit
|
protected static String |
stty(String args)
Run stty with arguments on the active terminal
|
void |
writeToInputStream(String data) |
clear, enableAlternateBuffer, enableMainBuffer, getCursor, getShell, in, isMainBuffer, moveCursor, setCursor
public void init(Settings settings)
Terminal
public int[] read() throws IOException
Terminal
IOException
Terminal
public boolean hasInput()
Terminal
public TerminalSize getSize()
public boolean isEchoEnabled()
Terminal
public void reset() throws IOException
Terminal
IOException
- streamTerminal
public void writeToInputStream(String data)
public void changeOutputStream(PrintStream output)
Terminal
output
- streampublic void close() throws IOException
IOException
protected static String stty(String args) throws IOException, InterruptedException
args
- argumentsIOException
- streamInterruptedException
- streampublic PrintStream err()
Shell
PrintStream
associated with the std errpublic PrintStream out()
Shell
PrintStream
associated with the std outCopyright © 2017 JBoss by Red Hat. All rights reserved.