code: func (s *Session) RequestPty(term string, h, w int, termmodes TerminalModes) error {
  	var tm []byte
  	for k, v := range termmodes {
  		kv := struct {
  			Key byte
  			Val uint32
  		}{k, v}
  
  		tm = append(tm, Marshal(&kv)...)
  	}
  	tm = append(tm, tty_OP_END)
  	req := ptyRequestMsg{
  		Term:     term,
  		Columns:  uint32(w),
  		Rows:     uint32(h),
  		Width:    uint32(w * 8),
  		Height:   uint32(h * 8),
  		Modelist: string(tm),
  	}
  	ok, err := s.ch.SendRequest("pty-req", true, Marshal(&req))
  	if err == nil && !ok {
  		err = errors.New("ssh: pty-req failed")
  	}
  	return err
  }
docs: // RequestPty requests the association of a pty with the session on the remote host.