CURLOPT_TELNETOPTIONS(3)
π CURLOPT_TELNETOPTIONS(3) β set of telnet options
Okay bestie, so you're poking at libcurl's manual, and this little icon is all about telling telnet what's up π¦
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TELNETOPTIONS,
struct curl_slist *cmds);
πΈ DESCRIPTION πΈ
So what you do is hand over a pointer to a curl_slist stuffed with variables that get passed to the telnet negotiations. The variables gotta be in the format <option=value> β that's the whole vibe, no cap.
libcurl supports these options: TTYPE, XDISPLOC and NEW_ENV. For the details, go read the TELNET standard, iykyk π
If you use this option multiple times, the last set list overrides the previous ones β it's giving main character energy, last one wins π
Set it to NULL to disable its use again.
β οΈ Lowkey important: libcurl does not copy the list. You have to keep it around until after the transfer has completed. Don't let it get freed on you, bestie π
π DEFAULT π
NULL
π¦ PROTOCOLS π¦
This functionality affects telnet only. Periodt.
β EXAMPLE β
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
struct curl_slist *options;
options = curl_slist_append(NULL, "TTTYPE=vt100");
options = curl_slist_append(options, "USER=foobar");
curl_easy_setopt(curl, CURLOPT_URL, "telnet://example.com/");
curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, options);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
curl_slist_free_all(options);
}
}
π AVAILABILITY π
Added in curl 7.7 β vintage, honestly π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK π«Ά β a non-zero value means an error occurred, so go check libcurl-errors(3), bestie.
π SEE ALSO π
Okay that's the whole page, mwah π This lil' gem comes to you from the libcurl manual, dated 2026-10-12 β go forth and negotiate your telnet options, icon β¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms