From d758759fcb0ce112337d809456c73ff58bf61ff6 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Thu, 16 Jan 2025 08:31:07 -0500 Subject: [PATCH] Sets default column size when terminal size is 0 (#5265) Sets a default column size of 80 characters if the terminal width is set to 0. This supports running the help command in a dumb terminal --- .../java/org/apache/accumulo/shell/commands/HelpCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/HelpCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/HelpCommand.java index c7e516c6172..baf740a141c 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/HelpCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/HelpCommand.java @@ -39,7 +39,8 @@ public class HelpCommand extends Command { @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws ShellCommandException, IOException { - int numColumns = shellState.getTerminal().getWidth(); + int numColumns = + (shellState.getTerminal().getWidth() == 0) ? 80 : shellState.getTerminal().getWidth(); if (cl.hasOption(noWrapOpt.getOpt())) { numColumns = Integer.MAX_VALUE; }