public class STTYModeSwitcher extends Object implements Closeable
try (STTYModeSwitcher tty = new STTYModeSwitcher(STTYMode.RAW)) {
// do stuff in raw mode.
}
| Constructor and Description |
|---|
STTYModeSwitcher(STTYMode mode)
Deprecated.
|
STTYModeSwitcher(STTYMode mode,
Runtime runtime)
Switch to the requested mode until closed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the terminal mode switcher and turn back the the mode before it
was opened.
|
static STTYMode |
currentMode()
Get the current TTY mode.
|
boolean |
didChangeMode() |
STTYMode |
getBefore()
Get the mode that was replaced by the switcher.
|
STTYMode |
getCurrentMode()
Get the current TTY mode.
|
STTYMode |
getMode()
Get the mode set by the seitcher.
|
@Deprecated public STTYModeSwitcher(STTYMode mode) throws IOException
STTY.setSTTYMode(STTYMode).mode - The mode to switch to.IOException - If unable to switch.public STTYModeSwitcher(STTYMode mode, Runtime runtime) throws IOException
mode - The mode to switch to.runtime - The runtime to execute stty commands on.IOException - If unable to switch.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - If unable to switch back.public STTYMode getMode()
public STTYMode getBefore()
public STTYMode getCurrentMode()
public boolean didChangeMode()
public static STTYMode currentMode()
Copyright © 2016. All rights reserved.