request_pty (Net::SSH::Connection::Channel)

    # File lib/net/ssh/connection/channel.rb, line 367
            def request_pty( opts = {} )
              invalid_opts = opts.keys - VALID_PTY_OPTIONS.keys
              unless invalid_opts.empty?
                raise ArgumentError,
                  "invalid option(s) to request_pty: #{invalid_opts.inspect}"
              end

              opts = VALID_PTY_OPTIONS.merge( opts )

              msg = @buffers.writer
              msg.write_string opts[ :term ]
              msg.write_long opts[ :chars_wide ]
              msg.write_long opts[ :chars_high ]
              msg.write_long opts[ :pixels_wide ]
              msg.write_long opts[ :pixels_high ]

              modes = @buffers.writer
              opts[ :modes ].each do |mode, data|
                modes.write_byte mode
                modes.write_long data
              end
              modes.write_byte Term::TTY_OP_END

              msg.write_string modes.to_s

              send_request "pty-req", msg, opts[:want_reply]
            end