Skip to content

Commit b140460

Browse files
authored
Adds property for jline to prefer using stdout vs stderr (apache#5221)
* Adds property for jline to always use stdout When the shell is being used with a `-e <command>` option jline does not write the output on stdout when also used with a pipe `|` operator. Instead the output is written to stderr. This causes frustration when attempting to script actions using the accumulo shell. * Set system out in TerminalBuilder instead Change the output behavior manually instead of using the jline properties.
1 parent 6fe8b0c commit b140460

File tree

1 file changed

+3
-1
lines changed
  • shell/src/main/java/org/apache/accumulo/shell

1 file changed

+3
-1
lines changed

shell/src/main/java/org/apache/accumulo/shell/Shell.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
import org.jline.terminal.Attributes;
176176
import org.jline.terminal.Terminal;
177177
import org.jline.terminal.TerminalBuilder;
178+
import org.jline.terminal.TerminalBuilder.SystemOutput;
178179
import org.slf4j.Logger;
179180
import org.slf4j.LoggerFactory;
180181

@@ -300,7 +301,8 @@ private AuthenticationToken getAuthenticationToken(String principal, String auth
300301
*/
301302
public boolean config(String... args) throws IOException {
302303
if (this.terminal == null) {
303-
this.terminal = TerminalBuilder.builder().jansi(false).build();
304+
this.terminal =
305+
TerminalBuilder.builder().jansi(false).systemOutput(SystemOutput.SysOut).build();
304306
}
305307
if (this.reader == null) {
306308
this.reader = LineReaderBuilder.builder().terminal(this.terminal).build();

0 commit comments

Comments
 (0)