libssh2_channel_request_pty_ex(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– libssh2_channel_request_pty_ex(3) πŸ’–

okay bestie, welcome to the libssh2 manual, this one's about libssh2_channel_request_pty_ex β€” the "pls give me a terminal on this channel" function πŸŽ€


✨ NAME ✨

libssh2_channel_request_pty_ex β€” short function description 🫢


🌸 SYNOPSIS 🌸

#include <libssh2.h>

int
libssh2_channel_request_pty_ex(LIBSSH2_CHANNEL *channel, const char *term,
                               unsigned int term_len,
                               const char *modes, unsigned int modes_len,
                               int width, int height,
                               int width_px, int height_px);

int
libssh2_channel_request_pty(LIBSSH2_CHANNEL *channel, const char *term);

πŸ¦‹ DESCRIPTION πŸ¦‹

no cap, here's the tea on every single argument πŸ‘‡

  • channel β€” a previously opened channel instance, like the one you got back from libssh2_channel_open_ex(3) ✨
  • term β€” the terminal emulation (e.g. vt102, ansi, etc...) πŸ‘‘
  • term_len β€” length of the term parameter
  • modes β€” terminal mode modifier values πŸ’…
  • modes_len β€” length of the modes parameter
  • width β€” width of the pty in characters
  • height β€” height of the pty in characters
  • width_px β€” width of the pty in pixels
  • height_px β€” height of the pty in pixels

so what does it actually do? it requests a PTY on an established channel. main character move, truly πŸ’œ

but lowkey β€” heads up β€” this does not make sense for all channel types, and the server may just ignore it entirely despite returning success 😭 like it'll say "sure babe" and then do nothing. rude but real.

πŸ”₯ RETURN VALUE πŸ”₯

returns 0 on success, or negative on failure. it returns LIBSSH2_ERROR_EAGAIN when it would otherwise block.

and listen, while LIBSSH2_ERROR_EAGAIN is a negative number, it is not really a failure per se β€” it's giving "not right now, try again" energy, not "everything is on fire" energy πŸ’€


🌈 ERRORS 🌈

  • LIBSSH2_ERROR_ALLOC β€” an internal memory allocation call failed 😭
  • LIBSSH2_ERROR_SOCKET_SEND β€” unable to send data on socket 🫠
  • LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED β€” (that's all the page says, bestie, no extra notes πŸ’…)

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole vibe check, bestie ✨ this page came from libssh2 0.15, dated 1 Jun 2007 β€” yeah she's vintage, she's iconic, she ate and left no crumbs πŸ’– mwah, go request that pty πŸŽ€πŸ¦‹