Sha256: 8086bcde39ed807fdc3c5e5010373a856fdd4dba25c6e48ed028e3aa46afaf7d

Contents?: true

Size: 845 Bytes

Versions: 61

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

class HighLine
  class Terminal
    # io/console option for HighLine::Terminal.
    # It's the most used terminal.
    # TODO: We're rescuing when not a terminal.
    #       We should make a more robust implementation.
    class IOConsole < Terminal
      # (see Terminal#terminal_size)
      def terminal_size
        output.winsize.reverse
      rescue Errno::ENOTTY
      end

      # (see Terminal#raw_no_echo_mode)
      def raw_no_echo_mode
        input.echo = false
      rescue Errno::ENOTTY
      end

      # (see Terminal#restore_mode)
      def restore_mode
        input.echo = true
      rescue Errno::ENOTTY
      end

      # (see Terminal#get_character)
      def get_character
        input.getch # from ruby io/console
      rescue Errno::ENOTTY
        input.getc
      end
    end
  end
end

Version data entries

61 entries across 47 versions & 3 rubygems

Version Path
brakeman-4.10.1 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-5.0.0.pre1 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.10.0 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.9.1 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.9.0 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.8.2 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.8.1 bundle/ruby/2.4.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.8.0 bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/highline-2.0.2/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/highline-2.0.2/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.0/bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.1/bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.2/bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
brakeman-4.7.2 bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/brakeman-4.7.0/bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/brakeman-4.7.1/bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/highline-2.0.2/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/highline-2.0.2/lib/highline/terminal/io_console.rb
brakeman-4.7.1 bundle/ruby/2.6.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/highline-2.0.2/lib/highline/terminal/io_console.rb