Skip to content

Commit

Permalink
Change to skip ioctl check on jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Oct 27, 2017
1 parent 1fe1c87 commit 5ca951d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/tty/screen/size.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def from_io_console
#
# @api private
def from_ioctl
return if jruby?
return unless output.respond_to?(:ioctl)

buffer = [0, 0, 0, 0].pack('SSSS')
Expand Down
6 changes: 6 additions & 0 deletions spec/unit/size_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ def ioctl(control, buf)
screen = described_class.new({}, output: output)
expect(screen.from_ioctl).to eq([51, 211])
end

it "skips reading on jruby" do
screen = described_class.new({})
allow(screen).to receive(:jruby?).and_return(true)
expect(screen.from_ioctl).to eq(nil)
end
end

context 'from tput' do
Expand Down

0 comments on commit 5ca951d

Please sign in to comment.