You are not logged in.

#1 2009-11-25 19:23:34

spupy
Member
Registered: 2009-08-12
Posts: 218

[SOLVED] Setting terminal title from within python

I know the following commands can set the title of the terminal window:

unset PROMPT_COMMAND
echo -en "\033]2;[b]$1[/b]\007"

However they do nothing if I call them from python using the commands module.
Is there a way to enable my console python scripts to change the title of the terminal they are running in?

Last edited by spupy (2009-11-25 19:44:30)


There are two types of people in this world - those who can count to 10 by using their fingers, and those who can count to 1023.

Offline

#2 2009-11-25 19:40:45

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] Setting terminal title from within python

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

Offline

#3 2009-11-25 19:44:46

spupy
Member
Registered: 2009-08-12
Posts: 218

Re: [SOLVED] Setting terminal title from within python

Procyon wrote:

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

Thank you very much! big_smile


There are two types of people in this world - those who can count to 10 by using their fingers, and those who can count to 1023.

Offline

Board footer

Powered by FluxBB