mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-19 22:43:04 +03:00
[FIX][FEUTURE] Исправил clear из консоли лаунчера.
This commit is contained in:
parent
f0c6c75b14
commit
bd819ac60e
3 changed files with 17 additions and 3 deletions
|
@ -131,6 +131,9 @@ function initConsoleScene() {
|
||||||
consoleMenu.lookup("#send").setOnAction(function(){
|
consoleMenu.lookup("#send").setOnAction(function(){
|
||||||
execCommand(text.getText());
|
execCommand(text.getText());
|
||||||
text.setText("");
|
text.setText("");
|
||||||
|
if (text.getText()=="clear") {
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
FunctionalBridge.addPlainOutput(function(string) {
|
FunctionalBridge.addPlainOutput(function(string) {
|
||||||
appendFunction(string+"\n");
|
appendFunction(string+"\n");
|
||||||
|
|
|
@ -153,5 +153,5 @@ public List<Category> getCategories() {
|
||||||
public abstract void bell() throws IOException;
|
public abstract void bell() throws IOException;
|
||||||
|
|
||||||
|
|
||||||
public abstract void clear() throws IOException;
|
public abstract void clear() throws IOException, InterruptedException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,19 @@ public void bell() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() throws IOException, InterruptedException {
|
||||||
throw new UnsupportedOperationException("clear terminal");
|
//throw new UnsupportedOperationException("clear terminal");
|
||||||
|
String os = System.getProperty("os.name");
|
||||||
|
|
||||||
|
if (os.contains("Windows"))
|
||||||
|
{
|
||||||
|
|
||||||
|
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Runtime.getRuntime().exec("clear");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue