Added support for Terminal.cursorStartOfLine() and clearToEndOfLine().
This commit is contained in:
@@ -131,4 +131,26 @@ public class TerminfoTerminal extends AbstractTerminal {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Terminal cursorStartOfLine() throws NativeException {
|
||||
stream.flush();
|
||||
FunctionResult result = new FunctionResult();
|
||||
TerminfoFunctions.startLine(result);
|
||||
if (result.isFailed()) {
|
||||
throw new NativeException(String.format("Could not move cursor to start of line for %s: %s", this, result.getMessage()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Terminal clearToEndOfLine() throws NativeException {
|
||||
stream.flush();
|
||||
FunctionResult result = new FunctionResult();
|
||||
TerminfoFunctions.clearToEndOfLine(result);
|
||||
if (result.isFailed()) {
|
||||
throw new NativeException(String.format("Could not clear to end of line for %s: %s", this, result.getMessage()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,4 +97,14 @@ public class WindowsTerminal extends AbstractTerminal {
|
||||
public Terminal cursorRight(int count) throws NativeException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Terminal cursorStartOfLine() throws NativeException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Terminal clearToEndOfLine() throws NativeException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,8 @@ public class TerminfoFunctions {
|
||||
public static native void up(int count, FunctionResult result);
|
||||
|
||||
public static native void down(int count, FunctionResult result);
|
||||
|
||||
public static native void startLine(FunctionResult result);
|
||||
|
||||
public static native void clearToEndOfLine(FunctionResult result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user