Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know if I should ask it here or on, I found this question here.

My question is similar, I want to change the title of a terminal, I'm using a Debian based distro, Terminator and ZSH, oh-my-zsh the title was fine with bash, but when I moved to ZSH, it shows /bin/zsh as title.

share|improve this question
This is a duplicate of Change iTerm2 window and tab titles in zsh, iow you con use the technique described there. – Daniël W. Crompton Aug 19 '13 at 22:55
@DaniëlW.Crompton really? it is a dupe? if so i'll close it right now, i linked to that question, so i know it is there, but didn't know it's a dupe because I'm using a different OS and emulator – Lynob Aug 19 '13 at 22:57
Did you try out what was advised in the question you linked to? – Daniël W. Crompton Aug 19 '13 at 22:59
@DaniëlW.Crompton yes, echo -ne "\e]1;this is the title\a and echo -ne "\e]1;$PWD\a" dont give errors but don't work, i tried unchecking all unless im missing something – Lynob Aug 19 '13 at 23:10
Did you try echo -ne "\e]0;$PWD\a" with a 0 rather than 1? – Daniël W. Crompton Aug 19 '13 at 23:13
up vote 6 down vote accepted

You set your window title with the xtem escape sequences, in most implementations the first will work best:

echo -en "\e]0;string\a" #-- Set icon name and window title to string
echo -en "\e]1;string\a" #-- Set icon name to string
echo -en "\e]2;string\a" #-- Set window title to string

EDIT: The above only sets the title once. To set zsh to always display the sting in the title you add the following to your .zprofile in your home directory:

case $TERM in
        precmd () {print -Pn "\e]0;string\a"}
share|improve this answer
i said earlier echo -ne "\e]0;$PWD\a" works but when i exit shell, it stops working... I tried you typed in the answer and i get zsh: command not found: stringa and zsh: command not found: e]1 and so on, all of them – Lynob Aug 19 '13 at 23:52
Updated the answer – Daniël W. Crompton Aug 20 '13 at 13:26

This should work regardless of the shell used:

printf "\033];%s\07\n" "hello world"
share|improve this answer

Well you can make a scrip that brings up a window and sets the name to be what you want. Execute the script to bring up the window with your name. You can also set the X,Y position and size of the window. You can make several and have windows named for every occasion.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .