Change Konsole name via Python

How can I change the name of Konsole in Python? I found this code:

>>> import sys >>> sys.stdout.write("\x1b]2;test\x07") 

But it only works with the Gnome terminal, not Konsole (on Kubuntu).

+4
source share
2 answers

I would ask "\x1b]0;test\x07" to try (note 0 instead of 2 ).

There is an open error that Konsole does not properly handle xterm escape sequences; it may not work until it is fixed.

+7
source
 dcop "$KONSOLE_DCOP_SESSION" renameSession "New title here" 

That should work. You can also run the command without the renameSession part to get a list of other parameters that you can change.

+2
source

Source: https://habr.com/ru/post/1416435/


All Articles