cplusplus.com
C++ : Forum : General C++ Programming : Coloured output over TCP
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs


question Coloured output over TCP

SiNT4X (2)
First post, hopefully not my last :)

So, I know I'm young, but I do know about the OLD BBS software (you know, the kind you telnet into, and everything is by console).

I also know that they run SOLELY on telnet (you dont download any client or anything - simply all by telnet), so this question may be advanced for someone.

I've always wondered - how do you -send- coloured text to a telnet console through network connections?

Hopefully someone can help :)

Thanks!

`SiN
SiNT4X (2)
Okay, so after a bit of clever googling, its quite obvious its done with ansi escape codes.

Now the question is: how? How can I send ANSI codes?
firedraco (4744)
Just shove them into a char* or an std::string and send them (at least that's what I do and it seems to work).

e.g.:
send("Red",/*...*/);
Zhuge (2205)
As firedraco says, you just send the sequences and the receiving terminal is expected to translate them. Of course, if it doesn't support them, it can either just print them or ignore them. I can't really think of any scenario where they wouldn't be translated but that doesn't mean they don't exist.
Topic archived. No new replies allowed.