[Python] Set title in Konsole (and other terminals)
I found a method to change the title of the terminal from Python. However it doesn't seem to work for me in Kubuntu 12.10 and Konsole as terminal. https://bbs.archlinux.org/viewtopic.php?id=85567
The code that supposed to work is:
Code:
import sys
sys.stdout.write("\x1b]2;test\x07")
To quickly try out yourself:
Type to enter the python shell and enter the two lines I quoted above.
This does not change the title in Konsole however. Neither do those lines give any errors. Is their another way to set the terminal title from within Python? Or is the problem just with KDE's Konsole?
Re: [Python] Set title in Konsole (and other terminals)
That command works in LXTerminal, and also in gnome-terminal.
According to this page you need to enable it in Preferences for Konsole, but I don't have KDE available at the moment to verify this.
Re: [Python] Set title in Konsole (and other terminals)
Thanks again spjackson for the quick reply. I'll try that later on and report back here :P
Re: [Python] Set title in Konsole (and other terminals)
So it's a Konsole specific 'problem'. After changing the tab tile to "%w" I get my custom titles. I'll mark this as solved. Thanks :P