How Can I change the title bar of the Terminal console in Linux?
In windows this can be done by the help of title command.
Is there anything equivalent to that?
Smith Thnx for your suggestion.
But how can I use the same from c++, using system() call?
I need the same in Linux OS. For WINDOWS I am done but 4 LINUX .... :-(
1 2 3 4 5 6 7 8 9 10 11 12
void setTitle(string titleMsg)
{
#ifdef WIN32
string title = "title ";
title += titleMsg.c_str();
system(title.c_str());
#else
/*
I want to do the above things in Linux as well.
*/
#endif
}
Sorry 'bout that. konsole seems a bit different. By default, my konsole's title bar displays "/home/jsmith - Shell - Konsole". Using my setxtitle trick, I can change it to "Foobar - Shell - Konsole". And by going to View ... Rename session I can change it to "Foobar - TurtleShell - Konsole". (I'm running FC2 / 2.6.5).
So it seems that it only partially works. It's probably doable using some X function, but I don't know anything about X programming. (Admittedly, I don't even know why the above trick works; I just saw some script do it years ago and copied the line of code).
But with the proper 0x0X put in. That should call that command through the console and change the title. cout << "" would only display it on screen. I don't have time atm to write the full code out sorry. But you should get the idea.