HBASE-2710. Shell should have default terminal width when detection fails

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@953529 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2010-06-11 01:27:06 +00:00
parent bdcc7f126a
commit 296b055f97
2 changed files with 8 additions and 0 deletions

View File

@ -381,6 +381,8 @@ Release 0.21.0 - Unreleased
HBASE-2684 TestMasterWrongRS flaky in trunk HBASE-2684 TestMasterWrongRS flaky in trunk
HBASE-2691 LeaseStillHeldException totally ignored by RS, wrongly named HBASE-2691 LeaseStillHeldException totally ignored by RS, wrongly named
HBASE-2703 ui not working in distributed context HBASE-2703 ui not working in distributed context
HBASE-2710 Shell should use default terminal width when autodetection fails
(Kannan Muthukkaruppan via Todd Lipcon)
IMPROVEMENTS IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable HBASE-1760 Cleanup TODOs in HTable

View File

@ -31,6 +31,12 @@ module Shell
def refresh_width() def refresh_width()
@max_width = Java::jline.Terminal.getTerminal().getTerminalWidth() @max_width = Java::jline.Terminal.getTerminal().getTerminalWidth()
# the above doesn't work in some terminals
# (such as shell running within emacs)
if @max_width == 0
@max_width = 100
end
end end
# Takes an output stream and a print width. # Takes an output stream and a print width.