Skip to content

Commit

Permalink
HBASE-26772 Shell suspended in background (#4137)
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Busbey <busbey@apache.org>
  • Loading branch information
petersomogyi committed Mar 1, 2022
1 parent b3292b8 commit 4ad66df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions hbase-shell/src/main/ruby/irb/hirb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialize(workspace = nil, input_method = nil)
# happen is the shell exiting because of failed IRB construction with
# no error (though we're not blanking STDERR)

# Map the '/dev/null' according to the runing platform
# Map the '/dev/null' according to the running platform
# Under Windows platform the 'dev/null' is not fully compliant with unix,
# and the 'NUL' object need to be use instead.
devnull = '/dev/null'
Expand All @@ -42,8 +42,10 @@ def initialize(workspace = nil, input_method = nil)
$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`
# in case the command is piped with hbase shell(eg - >echo 'list' | bin/hbase shell)
if $stdin.tty?
`stty icrnl <&2`
end
super(workspace, input_method)
ensure
f.close
Expand Down
4 changes: 3 additions & 1 deletion hbase-shell/src/main/ruby/jar-bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
include Java

# Some goodies for hirb. Should these be left up to the user's discretion?
require 'irb/completion'
if $stdin.tty?
require 'irb/completion'
end
require 'pathname'
require 'getoptlong'

Expand Down

0 comments on commit 4ad66df

Please sign in to comment.