- Added support for setting the terminal foreground color.
- Some improvements to error handling.
This commit is contained in:
@@ -1,20 +1,32 @@
|
||||
package net.rubygrapefruit.platform;
|
||||
|
||||
public interface Terminal {
|
||||
enum Color {
|
||||
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the terminal.
|
||||
*/
|
||||
TerminalSize getTerminalSize();
|
||||
|
||||
/**
|
||||
* Sets the terminal foreground color.
|
||||
*/
|
||||
Terminal foreground(Color color);
|
||||
|
||||
/**
|
||||
* Switches the terminal to bold mode.
|
||||
*/
|
||||
Terminal bold();
|
||||
|
||||
/**
|
||||
* Switches the terminal to bold mode, outputs the given text, then switches to normal mode.
|
||||
*/
|
||||
Terminal bold(String output);
|
||||
|
||||
/**
|
||||
* Switches the terminal to normal mode.
|
||||
*/
|
||||
Terminal normal();
|
||||
|
||||
/**
|
||||
* Switches the terminal to normal mode and restores default colors.
|
||||
*/
|
||||
Terminal reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user