Fix gnome-terminal bug

This commit is contained in:
crschnick
2023-03-13 21:44:38 +00:00
parent 516af8c66a
commit 9e505c68ed

View File

@@ -7,6 +7,7 @@ import io.xpipe.app.util.MacOsPermissions;
import io.xpipe.core.impl.LocalStore;
import io.xpipe.core.process.OsType;
import io.xpipe.core.process.ShellControl;
import lombok.Getter;
import java.util.List;
@@ -56,9 +57,20 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
public static final ExternalTerminalType GNOME_TERMINAL =
new SimpleType("gnomeTerminal", "gnome-terminal", "Gnome Terminal") {
@Override
public void launch(String name, String command) throws Exception {
try (ShellControl pc = LocalStore.getShell()) {
ApplicationHelper.checkSupport(pc, executable, getDisplayName());
var toExecute = executable + " " + toCommand(name, command);
toExecute = "GNOME_TERMINAL_SCREEN=\"\" nohup " + toExecute + " </dev/null &>/dev/null & disown";
pc.executeSimpleCommand(toExecute);
}
}
@Override
protected String toCommand(String name, String command) {
return "--title \"" + name + "\" -- " + command;
return "-v --title \"" + name + "\" -- " + command;
}
@Override
@@ -246,6 +258,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
}
}
@Getter
public abstract static class SimpleType extends ExternalApplicationType.PathApplication
implements ExternalTerminalType {