I'm trying to make a CLI with cross-platform support using Python and whenever the user starts the CLI it changes the title of the terminal. In Windows, I would use title but in Linux I don't know
By the way, I use WSL (Windows Subsystem for Linux) and I need in a Python app so it has to work with os.system()
I tried asking ChatGPT but it failed instead of changing the title of the window, it change it to this:
notmithun@HPE-BOOK840:~/scripts$ echo -ne '\\033]0;My new title\\007'
\033]0;My new title\007notmithun@HPE-BOOK840:~/scripts$
TL;DR:
What I want is to change the title of the Terminal window in Linux, similar to title in CMD
echo -en '\033]0;My new title\007'and maybesleep 2to ensure having time to read effect:echo -en '\033]0;My new title\007'; sleep 2echo -n $'\033]30;New Title\007'. See: superuser.com/a/1580062/340330