Renaming windows of shells in Ubuntu

How can you rename windows in Ubuntu?

I have a few terminals open. All of them have the name "Untitled window". I would like to rename them similarly as you can in Screen by C-A A.

2

3 Answers

The process is a little complex to explain here since it is different for every shell you use. Rather I'll give you two links:

There are a few other things to take into consideration. For a one time change common to all terminal sessions, you may want instead to simply alter Bash (if you use bash and under gnome) icon and add --title=title under Gnome.

For terminal windows I set

PROMPT_COMMAND='echo -ne "\033]0;xterm${XUSER} $$ ${USER}@${HOSTNAME}:${PWD}\007"'

in .bashrc (if $TERM is xterm or rxvt) to get pid, pwd et all in the window title. Further set XUSER=/someTask to put task related info into the terminal window title.

You could install and use xttitle (Note the doubled t in the name). I use it like this in a file sourced by my ~/.bashrc:

# from the "xttitle(1)" man page - put info in window title
update_title()
{ [ $TERM = xterm -o $TERM = xterm-color ] && xttitle "[$$] ${USER}@${HOSTNAME}:$PWD"
}
cd()
{ [ -z "$*" ] && builtin cd $HOME [ -n "$*" ] && builtin cd "$*" update_title
}

I also do this:

xttitle Mutt && mutt

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like