# File lib/net/ssh/connection/channel.rb, line 218
218:     def request_pty(opts={}, &block)
219:       extra = opts.keys - VALID_PTY_OPTIONS.keys
220:       raise ArgumentError, "invalid option(s) to request_pty: #{extra.inspect}" if extra.any?
221: 
222:       opts = VALID_PTY_OPTIONS.merge(opts)
223: 
224:       modes = opts[:modes].inject(Buffer.new) do |memo, (mode, data)|
225:         memo.write_byte(mode).write_long(data)
226:       end
227:       # mark the end of the mode opcode list with a 0 byte
228:       modes.write_byte(0)
229: 
230:       send_channel_request("pty-req", :string, opts[:term],
231:         :long, opts[:chars_wide], :long, opts[:chars_high],
232:         :long, opts[:pixels_wide], :long, opts[:pixels_high],
233:         :string, modes.to_s, &block)
234:     end