Fix grep console not working (#3012)

Signed-off-by: Jan N. Klug <github@klug.nrw>
pull/3015/head
J-N-K 2022-06-22 22:38:48 +02:00 committed by GitHub
parent 0562ffe95e
commit 453857770a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1 +1,3 @@
Karaf-Commands: org.openhab.core.io.console.karaf.internal
Automatic-Module-Name: ${def;bsn}
Bundle-SymbolicName: ${project.artifactId}

View File

@ -12,9 +12,11 @@
*/
package org.openhab.core.io.console.karaf.internal;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.List;
import org.apache.felix.service.command.Process;
import org.apache.karaf.shell.api.action.Action;
import org.apache.karaf.shell.api.action.lifecycle.Reference;
import org.apache.karaf.shell.api.action.lifecycle.Service;
@ -66,8 +68,8 @@ public class CommandWrapper implements Command, Action {
@Override
public Object execute(Session session, List<Object> argList) throws Exception {
String[] args = argList.stream().map(Object::toString).toArray(String[]::new);
final Console console = new OSGiConsole(getScope(), session.getConsole());
PrintStream out = Process.Utils.current().out();
final Console console = new OSGiConsole(getScope(), out);
if (args.length == 1 && "--help".equals(args[0])) {
for (final String usage : command.getUsages()) {