FBB::Tty(3bobcat)
π
FBB::Tty β a.k.a. the 3bobcat page babe, "Controls echoing of characters"
okay so bestie, welcome to FBB::Tty(3bobcat), the lil guy who decides whether the terminal shows what you're typing or keeps it lowkey secret π
β¨ NAME β¨
FBB::Tty β Controls echoing of characters entered at the terminal π
πΈ SYNOPSIS πΈ
#include <bobcat/tty>
Linking option: -lbobcat
π DESCRIPTION π
So like, Tty(3bobcat) objects are literally your little remote control for the echoing of characters typed at the terminal (usually at /dev/tty). And the reason you'd read straight from /dev/tty is iconic: it lets programs grab info (passwords, pass phrases, all that secret-girl stuff π) even when the standard input stream is redirected to a file. And fun fact, unless it's been redirected, std::cin is connected to /dev/tty. no cap.
You can use Tty(3bobcat) objects as stand-alone besties, or β and this is the usual move β you can insert or extract (usually anonymous) Tty(3bobcat) objects into or out of streams. And here's the thing: when you insert or extract those objects, the streams themselves are NOT affected. The only thing getting manipulated is the echoing of characters entered at /dev/tty. the way that works is so clean fr fr.
β οΈ ok important, listen up:Tty(3bobcat)'s destructor does NOT reset the echo-state of/dev/ttyback to its original value. it literally does not. so if you need that, you have to construct aTty(3bobcat)object first, and then call itsecho(Tty::RESET)member at the right moment. periodt.
π¦ NAMESPACE π¦
FBB
Every single constructor, member, operator and manipulator mentioned in this man-page is defined in the namespace FBB. that's the whole vibe.
π INHERITS FROM π
-
(yeah bestie, it inherits from nothing. it's self-made. main character energy π)
π ENUM π
The enum EchoType requests the type of echo-handling:
RESETβ used to reset/dev/tty's state back to the actual state it had when aTty(3bobcat)object was constructedONβ used to activate echoing of characters entered at/dev/ttyOFFβ used to suppress echoing of characters entered at/dev/tty
π§ CONSTRUCTORS π§
Tty()β the current state of/dev/ttyis saved. πΎTty(EchoType type)β the current state of/dev/ttyis saved, and the object's memberecho(type)is called. two things at once, we love a multitasker β¨
Copy and move constructors (and assignment operators) are available. π
π₯ OVERLOADED OPERATORS π₯
std::istream &operator>>(std::istream &in, Tty const &tty)β the extraction operator does not affectin, but/dev/tty's state is set according to the way thettyobject was constructed.std::ostream &operator<<(std::ostream &out, Tty const &tty)β the insertion operator does not affectout, but/dev/tty's state is set according to the way thettyobject was constructed.
π MEMBER FUNCTION π
echo(EchoType type)β/Dev/tty's state is set according to theEchoTypevalue that's passed to this member.
β EXAMPLE β
ok here's the whole thing, copy it, it's cute:
#include <iostream>
#include <string>
#include <bobcat/tty>
using namespace std;
using namespace FBB;
int main()
{
cout << "Enter some text (not echoed): " << Tty(Tty::OFF);
string line;
getline(cin, line);
cout << "\n"
"You entered: `" << line << "β\n";
cout << "Enter some text (echoed): ";
getline(cin >> Tty(Tty::ON), line);
cout << "You entered: `" << line << "β\n";
}
πΈ FILES πΈ
bobcat/tty β defines the class interface
π SEE ALSO π
π BUGS π
None Reported.
(yes bestie, none. we ate. π)
π«Ά BOBCAT PROJECT FILES π«Ά
- https://fbb-git.gitlab.io/bobcat/ β gitlab project page;
Debian Bobcat project files:
libbobcat6β debian package containing the shared library, changelog and copyright note;libbobcat-devβ debian package containing the static library, headers, manual pages, and developer info;
π BOBCAT π
Bobcat is an acronym of Brokkenβs Own Base Classes And Templates. iykyk π
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL).
π AUTHOR π
Frank B. Brokken (f.b.brokken@rug.nl).
ok and that's a wrap bestie, this was libbobcat-dev_6.15.01, dated 2005-2026, and the page is literally called FBB::Tty(3bobcat). go forth and control those echoes, you absolute icon π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms