From e67a67d44422ca3cd7a610e4bb07e41c61301a4c Mon Sep 17 00:00:00 2001 From: Mike Drob Date: Tue, 19 Dec 2017 16:36:46 -0600 Subject: [PATCH] HBASE-18970 fix hbase shell reading interactive input (Amit Virmani) --- hbase-shell/src/main/ruby/irb/hirb.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hbase-shell/src/main/ruby/irb/hirb.rb b/hbase-shell/src/main/ruby/irb/hirb.rb index 904a0001019..f8eed2a5f97 100644 --- a/hbase-shell/src/main/ruby/irb/hirb.rb +++ b/hbase-shell/src/main/ruby/irb/hirb.rb @@ -40,6 +40,10 @@ module IRB devnull = 'NUL' if WINDOZE f = File.open(devnull, 'w') $stdout = f + # This is a workaround for the jruby issue 1372. + # The stderr is an input to stty to re-adjust the terminal for the error('stdin isnt a terminal') + # incase the command is piped with hbase shell(eg - >echo 'list' | bin/hbase shell) + `stty icrnl <&2` super ensure f.close