Though I know this topic is somewhat dusty, I could easily ask what terminal are you talking about?
1. This sounds like a Linux OS settings problem.
2. This is probably already implemented and probably not involved with the C++ language.
3. If so please, by all means, elaborate your problem.