libssh2_channel_request_pty_ex(3)
π 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 fromlibssh2_channel_open_ex(3)β¨termβ the terminal emulation (e.g.vt102,ansi, etc...) πterm_lenβ length of thetermparametermodesβ terminal mode modifier values πmodes_lenβ length of themodesparameterwidthβ width of the pty in charactersheightβ height of the pty in characterswidth_pxβ width of the pty in pixelsheight_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 ππ¦
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms