How to change Gnome-Terminal title?
I have several instances of terminals running in my working environment, what I would like is to set a specific title for each one, in order to have a clear idea what purpose the specific terminal serves i.e. Apache, editing_ini, postgres etc...
Of course from the command line.
command-line gnome-terminal titlebar
add a comment |
I have several instances of terminals running in my working environment, what I would like is to set a specific title for each one, in order to have a clear idea what purpose the specific terminal serves i.e. Apache, editing_ini, postgres etc...
Of course from the command line.
command-line gnome-terminal titlebar
Further to Ward's comment: Don't forget to "unset PROMPT_COMMAND" before you send the title-change escape sequence, otherwise any change you make will be lost as soon as the next shell prompt.
– Jon Green
Sep 2 '11 at 11:38
For a similar question for KDE, see stackoverflow.com/questions/8782159/…
– naught101
May 29 '12 at 2:22
I had this issue when switching from OS X to Ubuntu. To obtain custom titles within a multi-tab set-up, I usedgnome-terminal --load-config
together with this script I've written.
– halfer
Apr 13 '14 at 1:29
3
add following to your .bashrc file in your home dir# set title of current terminal setTerminalTitle(){ echo -ne "33]0;${1}07" } alias termttl=setTerminalTitle
now you can use termttl alias for setting title e.g.termttl askubuntu
– urmalp
Oct 11 '15 at 5:33
add a comment |
I have several instances of terminals running in my working environment, what I would like is to set a specific title for each one, in order to have a clear idea what purpose the specific terminal serves i.e. Apache, editing_ini, postgres etc...
Of course from the command line.
command-line gnome-terminal titlebar
I have several instances of terminals running in my working environment, what I would like is to set a specific title for each one, in order to have a clear idea what purpose the specific terminal serves i.e. Apache, editing_ini, postgres etc...
Of course from the command line.
command-line gnome-terminal titlebar
command-line gnome-terminal titlebar
edited Jun 24 '16 at 18:09
zahypeti
447
447
asked Jan 20 '11 at 13:20
toplesstopless
3,46983040
3,46983040
Further to Ward's comment: Don't forget to "unset PROMPT_COMMAND" before you send the title-change escape sequence, otherwise any change you make will be lost as soon as the next shell prompt.
– Jon Green
Sep 2 '11 at 11:38
For a similar question for KDE, see stackoverflow.com/questions/8782159/…
– naught101
May 29 '12 at 2:22
I had this issue when switching from OS X to Ubuntu. To obtain custom titles within a multi-tab set-up, I usedgnome-terminal --load-config
together with this script I've written.
– halfer
Apr 13 '14 at 1:29
3
add following to your .bashrc file in your home dir# set title of current terminal setTerminalTitle(){ echo -ne "33]0;${1}07" } alias termttl=setTerminalTitle
now you can use termttl alias for setting title e.g.termttl askubuntu
– urmalp
Oct 11 '15 at 5:33
add a comment |
Further to Ward's comment: Don't forget to "unset PROMPT_COMMAND" before you send the title-change escape sequence, otherwise any change you make will be lost as soon as the next shell prompt.
– Jon Green
Sep 2 '11 at 11:38
For a similar question for KDE, see stackoverflow.com/questions/8782159/…
– naught101
May 29 '12 at 2:22
I had this issue when switching from OS X to Ubuntu. To obtain custom titles within a multi-tab set-up, I usedgnome-terminal --load-config
together with this script I've written.
– halfer
Apr 13 '14 at 1:29
3
add following to your .bashrc file in your home dir# set title of current terminal setTerminalTitle(){ echo -ne "33]0;${1}07" } alias termttl=setTerminalTitle
now you can use termttl alias for setting title e.g.termttl askubuntu
– urmalp
Oct 11 '15 at 5:33
Further to Ward's comment: Don't forget to "unset PROMPT_COMMAND" before you send the title-change escape sequence, otherwise any change you make will be lost as soon as the next shell prompt.
– Jon Green
Sep 2 '11 at 11:38
Further to Ward's comment: Don't forget to "unset PROMPT_COMMAND" before you send the title-change escape sequence, otherwise any change you make will be lost as soon as the next shell prompt.
– Jon Green
Sep 2 '11 at 11:38
For a similar question for KDE, see stackoverflow.com/questions/8782159/…
– naught101
May 29 '12 at 2:22
For a similar question for KDE, see stackoverflow.com/questions/8782159/…
– naught101
May 29 '12 at 2:22
I had this issue when switching from OS X to Ubuntu. To obtain custom titles within a multi-tab set-up, I used
gnome-terminal --load-config
together with this script I've written.– halfer
Apr 13 '14 at 1:29
I had this issue when switching from OS X to Ubuntu. To obtain custom titles within a multi-tab set-up, I used
gnome-terminal --load-config
together with this script I've written.– halfer
Apr 13 '14 at 1:29
3
3
add following to your .bashrc file in your home dir
# set title of current terminal setTerminalTitle(){ echo -ne "33]0;${1}07" } alias termttl=setTerminalTitle
now you can use termttl alias for setting title e.g. termttl askubuntu
– urmalp
Oct 11 '15 at 5:33
add following to your .bashrc file in your home dir
# set title of current terminal setTerminalTitle(){ echo -ne "33]0;${1}07" } alias termttl=setTerminalTitle
now you can use termttl alias for setting title e.g. termttl askubuntu
– urmalp
Oct 11 '15 at 5:33
add a comment |
12 Answers
12
active
oldest
votes
The most userfriendly way is picking it from the menu Terminal -> "Set Title...".
There are other ways however, you can also issue
gnome-terminal --title="SOME TITLE HERE"
This might not give the desired effect since there is a big chance that your
.bashrc
overwrites that behaviour.
Bringing us to the last method, which I shamelessly ripped out of my
.bashrc
.
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
As an extra reference, this is the particular line in my .bashrc
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}07"'
You may also need to comment this code out in your ~/.bashrc
case "$TERM" in
xterm*|rxvt*)
# JEFFYEE REMOVED because it makes commands to title() not work
#PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"
;;
*)
;;
esac
2
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
1
@Ward:PROMPT_COMMAND
is a program to run.PS1
andPS1
are textual strings that are displayed. In the example above the command that is run isecho
, which then simply prints out a string. Seeman bash
or manpages.ubuntu.com/bash for more details.
– sladen
Mar 31 '11 at 22:25
27
GNOME Terminal 3.16.2 saysOption "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
8
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
2
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
|
show 11 more comments
Ward's answer is great if you want to set your title based on what host you're on etc every time you open a terminal. If you just want to quickly set a title though, you can just run echo by itself:
echo -ne "33]0;SOME TITLE HERE07"
or make a simple bash script, say termtitle
#!/bin/bash
echo -ne "33]0;${1}07"
which you can run with termtitle "some title here"
1
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
3
or similarly we can add as bash alias by adding below lines in ~/.bash_aliasesfunction set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use:$ title term_title
– murarisumit
Sep 22 '16 at 6:10
9
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
1
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
2
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.$var_log
and${var}_log
are very different things, and the difference can cause bugs in scripts.
– naught101
Sep 10 '17 at 10:50
|
show 3 more comments
If you use the Vim editor, you can also enable this option in your vimrc:
:set title
which is disabled by default. It will set cool terminal titles showing the filename which you are editing at the moment and some other things.
add a comment |
For the sake of completeness, I would add that you can also set the gnome-terminal
title using this command:
wmctrl -r :ACTIVE: -N "MyWindowTitle"
You'll need to install the package wmctrl first.
1
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
2
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
add a comment |
Argh, so many answers...
I tried wmctrl
, which almost worked, except I couldn't get it to change the icon title, at least not permanently.
The problem is that the PS1 in Bash in Ubuntu sets the title.
The default PS1 is
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w$
... which sets the title in the first escape sequence: e]0;u@h: wa
Thus, there are two solutions:
Solution 1: simplify PS1, then use PROMPT_COMMAND
Change PS1 to something simpler:
PS1="u@h:w$ "
Then use the PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
Solution 2: directly modify PS1
Simply modify PS1 with new title:
PS1='[e]0;newtitlea]${debian_chroot:+($debian_chroot)}u@h:w$ '
hi, I like your answer quite a lot. Would you mind explaining the role of]0;
in your code? I think I found the meaning ofecho -e '07 33'
with theascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …
– isomorphismes
Mar 10 '17 at 11:28
@isoe
or33
is the escape (ESC) character, which starts an escape sequence.]
starts an operating system command (OSC). For an xterm,0;
means "set the title", anda
or07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
– wjandrea
Feb 1 at 15:51
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
add a comment |
If you are a Ubuntu user, you can change the title of a gnome-terminal tab using the HUD.
While in the gnome-terminal, hit Alt to bring up the HUD, type the first few letters, e.g. "tit", hit enter and type in your new title.
This is a very quick method and avoids using the mouse.
1
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
theF2
key also avoids the mouse.
– isomorphismes
Mar 10 '17 at 11:31
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
add a comment |
Another way of changing the title of gnome-terminal
is by using gconftool-2
; this changes the initial terminal title for the profile selected, so you could have different profiles associated with titles such as 'Apache', 'Editing', etc. You would then launch gnome-terminal
with the appropriate profile to get the terminal title you had specified. This is in contrast to gnome-terminal --title "name"
which changes the title per terminal, but doesn't affect the initial title specified in the profile.
You could use the following command in a script to set the name of the terminal for a profile, and you could have the name of the terminal change at certain times in the day to remind you of things:
gconftool-2 --set /apps/gnome-terminal/profiles/Default/title --type=string "Apache"
This is for the default profile, but you could set the title for other profiles as well by changing, for example, Default
to another profile like Profile0
:
gconftool-2 --set /apps/gnome-terminal/profiles/Profile0/title --type=string "Editing"
I thought this way of changing the title is of use because of the way it could be used in scripting, or just as a quick command-line way to set the title for the profile. Note that sometimes you have to relaunch the terminal with the specified profile for the gconftool-2
setting to take affect. The complete settings available for gnome-terminal
can be listed with gconftool-2 -R /apps/gnome-terminal
.
add a comment |
Another solution is to use xdotool to simulate keystrokes, maybe useful in scripts:
Set a keyboard shortcut in gnome-terminal:
Edit > Keyboard Shortcuts... > Terminal > Set Title
For example assing the
Shift+Ctrl+Y
.
Install
xdotool
if you don't have it already:
sudo apt-get install xdotool
The following sequence of commands (that you can use also in a bash script) will set the terminal/tab title (escape the spaces with
):
xdotool key ctrl+shift+y
xdotool type My new fabulous title
xdotool key Return
[optional] You can also use xdotool to e.g. open a new tab and set the title with the above commands, using:
xdotool key ctrl+shift+t
Consider adding a sleep time before and after opening a new tab, e.g.
sleep 1
(to wait for 1 second).
This is not the most elegant solution, but it worked for me! The previous answers did not work in my case. I use gnome-terminal in Ubuntu 14.04 and I wanted to make a bash script.
add a comment |
To display only the current working directory in the title, try this in your '.bashrc' :
PROMPT_COMMAND='echo -ne "33]0; ${PWD##*/}07"'
or
PROMPT_COMMAND='echo -ne "33]0;$(basename ${PWD})07"'
add a comment |
This worked in my Gnome Terminal 3.18.3.
Edit your .bashrc file and add this function
# Update gnome terminal title
function termtitle() {
# take argument
TITLE=$1
shift
# update title
PROMPT_COMMAND='echo -ne "33]0; $TITLE 07"'
}
Don't forget to source
your .bashrc file
$ source ~/.bashrc
And then you can simply update you'll be able to change terminal title like this:
$ termtitle "MariaDB CLI"
add a comment |
In case any poor souls like myself are forced to use tcsh, try something like this in your .cshrc:
set prompt='%{33]0;%n@%m07%}%~%# '
Source and more details: http://tldp.org/HOWTO/Xterm-Title-4.html
add a comment |
If you are using gnome 3, the convenient Terminal > Set Title
menu option has been removed. You can install a gnome 2 forked terminal which still has that "Set Title" menu option, and run that instead:
sudo apt-get install mate-terminal
Instead of running "Terminal", run "MATE Terminal". You should probably also select mate-terminal in sudo update-alternatives --config x-terminal-emulator
.
add a comment |
protected by Community♦ Jan 5 '15 at 18:01
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
12 Answers
12
active
oldest
votes
12 Answers
12
active
oldest
votes
active
oldest
votes
active
oldest
votes
The most userfriendly way is picking it from the menu Terminal -> "Set Title...".
There are other ways however, you can also issue
gnome-terminal --title="SOME TITLE HERE"
This might not give the desired effect since there is a big chance that your
.bashrc
overwrites that behaviour.
Bringing us to the last method, which I shamelessly ripped out of my
.bashrc
.
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
As an extra reference, this is the particular line in my .bashrc
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}07"'
You may also need to comment this code out in your ~/.bashrc
case "$TERM" in
xterm*|rxvt*)
# JEFFYEE REMOVED because it makes commands to title() not work
#PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"
;;
*)
;;
esac
2
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
1
@Ward:PROMPT_COMMAND
is a program to run.PS1
andPS1
are textual strings that are displayed. In the example above the command that is run isecho
, which then simply prints out a string. Seeman bash
or manpages.ubuntu.com/bash for more details.
– sladen
Mar 31 '11 at 22:25
27
GNOME Terminal 3.16.2 saysOption "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
8
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
2
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
|
show 11 more comments
The most userfriendly way is picking it from the menu Terminal -> "Set Title...".
There are other ways however, you can also issue
gnome-terminal --title="SOME TITLE HERE"
This might not give the desired effect since there is a big chance that your
.bashrc
overwrites that behaviour.
Bringing us to the last method, which I shamelessly ripped out of my
.bashrc
.
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
As an extra reference, this is the particular line in my .bashrc
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}07"'
You may also need to comment this code out in your ~/.bashrc
case "$TERM" in
xterm*|rxvt*)
# JEFFYEE REMOVED because it makes commands to title() not work
#PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"
;;
*)
;;
esac
2
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
1
@Ward:PROMPT_COMMAND
is a program to run.PS1
andPS1
are textual strings that are displayed. In the example above the command that is run isecho
, which then simply prints out a string. Seeman bash
or manpages.ubuntu.com/bash for more details.
– sladen
Mar 31 '11 at 22:25
27
GNOME Terminal 3.16.2 saysOption "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
8
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
2
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
|
show 11 more comments
The most userfriendly way is picking it from the menu Terminal -> "Set Title...".
There are other ways however, you can also issue
gnome-terminal --title="SOME TITLE HERE"
This might not give the desired effect since there is a big chance that your
.bashrc
overwrites that behaviour.
Bringing us to the last method, which I shamelessly ripped out of my
.bashrc
.
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
As an extra reference, this is the particular line in my .bashrc
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}07"'
You may also need to comment this code out in your ~/.bashrc
case "$TERM" in
xterm*|rxvt*)
# JEFFYEE REMOVED because it makes commands to title() not work
#PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"
;;
*)
;;
esac
The most userfriendly way is picking it from the menu Terminal -> "Set Title...".
There are other ways however, you can also issue
gnome-terminal --title="SOME TITLE HERE"
This might not give the desired effect since there is a big chance that your
.bashrc
overwrites that behaviour.
Bringing us to the last method, which I shamelessly ripped out of my
.bashrc
.
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
As an extra reference, this is the particular line in my .bashrc
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}07"'
You may also need to comment this code out in your ~/.bashrc
case "$TERM" in
xterm*|rxvt*)
# JEFFYEE REMOVED because it makes commands to title() not work
#PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"
;;
*)
;;
esac
edited Mar 31 '11 at 22:06
Community♦
1
1
answered Jan 20 '11 at 13:51
Ward MuylaertWard Muylaert
3,18821828
3,18821828
2
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
1
@Ward:PROMPT_COMMAND
is a program to run.PS1
andPS1
are textual strings that are displayed. In the example above the command that is run isecho
, which then simply prints out a string. Seeman bash
or manpages.ubuntu.com/bash for more details.
– sladen
Mar 31 '11 at 22:25
27
GNOME Terminal 3.16.2 saysOption "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
8
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
2
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
|
show 11 more comments
2
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
1
@Ward:PROMPT_COMMAND
is a program to run.PS1
andPS1
are textual strings that are displayed. In the example above the command that is run isecho
, which then simply prints out a string. Seeman bash
or manpages.ubuntu.com/bash for more details.
– sladen
Mar 31 '11 at 22:25
27
GNOME Terminal 3.16.2 saysOption "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
8
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
2
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
2
2
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
Need to comment out or remove as you mentioned in order to take effect!
– topless
Jan 20 '11 at 15:49
1
1
@Ward:
PROMPT_COMMAND
is a program to run. PS1
and PS1
are textual strings that are displayed. In the example above the command that is run is echo
, which then simply prints out a string. See man bash
or manpages.ubuntu.com/bash for more details.– sladen
Mar 31 '11 at 22:25
@Ward:
PROMPT_COMMAND
is a program to run. PS1
and PS1
are textual strings that are displayed. In the example above the command that is run is echo
, which then simply prints out a string. See man bash
or manpages.ubuntu.com/bash for more details.– sladen
Mar 31 '11 at 22:25
27
27
GNOME Terminal 3.16.2 says
Option "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
GNOME Terminal 3.16.2 says
Option "--title" is no longer supported in this version of gnome-terminal.
– Ivan Kozik
Nov 18 '15 at 21:23
8
8
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
On Gnome 3.18.3, there is no "Set title" entry in the menus :/
– shadi
Sep 26 '16 at 4:46
2
2
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
For anyone else confused by the gobbledegook in the strings above, they are ANSI escape characters - see e.g. lihaoyi.com/post/…
– WillC
Feb 24 '17 at 0:21
|
show 11 more comments
Ward's answer is great if you want to set your title based on what host you're on etc every time you open a terminal. If you just want to quickly set a title though, you can just run echo by itself:
echo -ne "33]0;SOME TITLE HERE07"
or make a simple bash script, say termtitle
#!/bin/bash
echo -ne "33]0;${1}07"
which you can run with termtitle "some title here"
1
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
3
or similarly we can add as bash alias by adding below lines in ~/.bash_aliasesfunction set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use:$ title term_title
– murarisumit
Sep 22 '16 at 6:10
9
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
1
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
2
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.$var_log
and${var}_log
are very different things, and the difference can cause bugs in scripts.
– naught101
Sep 10 '17 at 10:50
|
show 3 more comments
Ward's answer is great if you want to set your title based on what host you're on etc every time you open a terminal. If you just want to quickly set a title though, you can just run echo by itself:
echo -ne "33]0;SOME TITLE HERE07"
or make a simple bash script, say termtitle
#!/bin/bash
echo -ne "33]0;${1}07"
which you can run with termtitle "some title here"
1
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
3
or similarly we can add as bash alias by adding below lines in ~/.bash_aliasesfunction set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use:$ title term_title
– murarisumit
Sep 22 '16 at 6:10
9
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
1
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
2
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.$var_log
and${var}_log
are very different things, and the difference can cause bugs in scripts.
– naught101
Sep 10 '17 at 10:50
|
show 3 more comments
Ward's answer is great if you want to set your title based on what host you're on etc every time you open a terminal. If you just want to quickly set a title though, you can just run echo by itself:
echo -ne "33]0;SOME TITLE HERE07"
or make a simple bash script, say termtitle
#!/bin/bash
echo -ne "33]0;${1}07"
which you can run with termtitle "some title here"
Ward's answer is great if you want to set your title based on what host you're on etc every time you open a terminal. If you just want to quickly set a title though, you can just run echo by itself:
echo -ne "33]0;SOME TITLE HERE07"
or make a simple bash script, say termtitle
#!/bin/bash
echo -ne "33]0;${1}07"
which you can run with termtitle "some title here"
answered May 29 '12 at 2:20
naught101naught101
8431117
8431117
1
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
3
or similarly we can add as bash alias by adding below lines in ~/.bash_aliasesfunction set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use:$ title term_title
– murarisumit
Sep 22 '16 at 6:10
9
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
1
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
2
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.$var_log
and${var}_log
are very different things, and the difference can cause bugs in scripts.
– naught101
Sep 10 '17 at 10:50
|
show 3 more comments
1
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
3
or similarly we can add as bash alias by adding below lines in ~/.bash_aliasesfunction set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use:$ title term_title
– murarisumit
Sep 22 '16 at 6:10
9
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
1
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
2
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.$var_log
and${var}_log
are very different things, and the difference can cause bugs in scripts.
– naught101
Sep 10 '17 at 10:50
1
1
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
This is the answer you are looking for
– iondiode
Apr 28 '16 at 16:09
3
3
or similarly we can add as bash alias by adding below lines in ~/.bash_aliases
function set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use: $ title term_title
– murarisumit
Sep 22 '16 at 6:10
or similarly we can add as bash alias by adding below lines in ~/.bash_aliases
function set_title() { echo -ne "33]0;${1}07" } alias title=set_title
and then use: $ title term_title
– murarisumit
Sep 22 '16 at 6:10
9
9
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
Sadly doesn't seem to work for me in GNOME terminal 3.6.2.
– austinmarton
Jan 26 '17 at 23:36
1
1
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
Also doesn't seem to work in xterm 322 or konsole 16.12... I don't know if there's a new method, unfortunately :(
– naught101
Jan 27 '17 at 0:49
2
2
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.
$var_log
and ${var}_log
are very different things, and the difference can cause bugs in scripts.– naught101
Sep 10 '17 at 10:50
@3ocene it doesn't actually matter in this case, they are the same thing, but it's a good habit to get into, because e.g.
$var_log
and ${var}_log
are very different things, and the difference can cause bugs in scripts.– naught101
Sep 10 '17 at 10:50
|
show 3 more comments
If you use the Vim editor, you can also enable this option in your vimrc:
:set title
which is disabled by default. It will set cool terminal titles showing the filename which you are editing at the moment and some other things.
add a comment |
If you use the Vim editor, you can also enable this option in your vimrc:
:set title
which is disabled by default. It will set cool terminal titles showing the filename which you are editing at the moment and some other things.
add a comment |
If you use the Vim editor, you can also enable this option in your vimrc:
:set title
which is disabled by default. It will set cool terminal titles showing the filename which you are editing at the moment and some other things.
If you use the Vim editor, you can also enable this option in your vimrc:
:set title
which is disabled by default. It will set cool terminal titles showing the filename which you are editing at the moment and some other things.
edited Jan 20 '11 at 15:42
answered Jan 20 '11 at 14:40
ulidtkoulidtko
3,78212642
3,78212642
add a comment |
add a comment |
For the sake of completeness, I would add that you can also set the gnome-terminal
title using this command:
wmctrl -r :ACTIVE: -N "MyWindowTitle"
You'll need to install the package wmctrl first.
1
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
2
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
add a comment |
For the sake of completeness, I would add that you can also set the gnome-terminal
title using this command:
wmctrl -r :ACTIVE: -N "MyWindowTitle"
You'll need to install the package wmctrl first.
1
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
2
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
add a comment |
For the sake of completeness, I would add that you can also set the gnome-terminal
title using this command:
wmctrl -r :ACTIVE: -N "MyWindowTitle"
You'll need to install the package wmctrl first.
For the sake of completeness, I would add that you can also set the gnome-terminal
title using this command:
wmctrl -r :ACTIVE: -N "MyWindowTitle"
You'll need to install the package wmctrl first.
edited Sep 23 '16 at 0:03
naught101
8431117
8431117
answered Jan 23 '11 at 0:57
IsaiahIsaiah
43.6k21119138
43.6k21119138
1
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
2
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
add a comment |
1
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
2
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
1
1
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
MyWindowTitle does not show up in title of terminal. It shows up when I do wmctrl -m.
– sureshvv
Aug 4 '15 at 7:24
2
2
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
Note that wmctrl changes window title and not the tab title, whereas the escaped characters solution changes the tab title. Moreover, window title change back to original tab title as soon as you switch between tabs.
– redochka
Nov 13 '15 at 19:32
add a comment |
Argh, so many answers...
I tried wmctrl
, which almost worked, except I couldn't get it to change the icon title, at least not permanently.
The problem is that the PS1 in Bash in Ubuntu sets the title.
The default PS1 is
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w$
... which sets the title in the first escape sequence: e]0;u@h: wa
Thus, there are two solutions:
Solution 1: simplify PS1, then use PROMPT_COMMAND
Change PS1 to something simpler:
PS1="u@h:w$ "
Then use the PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
Solution 2: directly modify PS1
Simply modify PS1 with new title:
PS1='[e]0;newtitlea]${debian_chroot:+($debian_chroot)}u@h:w$ '
hi, I like your answer quite a lot. Would you mind explaining the role of]0;
in your code? I think I found the meaning ofecho -e '07 33'
with theascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …
– isomorphismes
Mar 10 '17 at 11:28
@isoe
or33
is the escape (ESC) character, which starts an escape sequence.]
starts an operating system command (OSC). For an xterm,0;
means "set the title", anda
or07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
– wjandrea
Feb 1 at 15:51
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
add a comment |
Argh, so many answers...
I tried wmctrl
, which almost worked, except I couldn't get it to change the icon title, at least not permanently.
The problem is that the PS1 in Bash in Ubuntu sets the title.
The default PS1 is
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w$
... which sets the title in the first escape sequence: e]0;u@h: wa
Thus, there are two solutions:
Solution 1: simplify PS1, then use PROMPT_COMMAND
Change PS1 to something simpler:
PS1="u@h:w$ "
Then use the PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
Solution 2: directly modify PS1
Simply modify PS1 with new title:
PS1='[e]0;newtitlea]${debian_chroot:+($debian_chroot)}u@h:w$ '
hi, I like your answer quite a lot. Would you mind explaining the role of]0;
in your code? I think I found the meaning ofecho -e '07 33'
with theascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …
– isomorphismes
Mar 10 '17 at 11:28
@isoe
or33
is the escape (ESC) character, which starts an escape sequence.]
starts an operating system command (OSC). For an xterm,0;
means "set the title", anda
or07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
– wjandrea
Feb 1 at 15:51
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
add a comment |
Argh, so many answers...
I tried wmctrl
, which almost worked, except I couldn't get it to change the icon title, at least not permanently.
The problem is that the PS1 in Bash in Ubuntu sets the title.
The default PS1 is
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w$
... which sets the title in the first escape sequence: e]0;u@h: wa
Thus, there are two solutions:
Solution 1: simplify PS1, then use PROMPT_COMMAND
Change PS1 to something simpler:
PS1="u@h:w$ "
Then use the PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
Solution 2: directly modify PS1
Simply modify PS1 with new title:
PS1='[e]0;newtitlea]${debian_chroot:+($debian_chroot)}u@h:w$ '
Argh, so many answers...
I tried wmctrl
, which almost worked, except I couldn't get it to change the icon title, at least not permanently.
The problem is that the PS1 in Bash in Ubuntu sets the title.
The default PS1 is
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w$
... which sets the title in the first escape sequence: e]0;u@h: wa
Thus, there are two solutions:
Solution 1: simplify PS1, then use PROMPT_COMMAND
Change PS1 to something simpler:
PS1="u@h:w$ "
Then use the PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "33]0;SOME TITLE HERE07"'
Solution 2: directly modify PS1
Simply modify PS1 with new title:
PS1='[e]0;newtitlea]${debian_chroot:+($debian_chroot)}u@h:w$ '
edited Feb 1 at 15:21
wjandrea
9,33842664
9,33842664
answered Feb 7 '13 at 3:36
Hugh PerkinsHugh Perkins
32126
32126
hi, I like your answer quite a lot. Would you mind explaining the role of]0;
in your code? I think I found the meaning ofecho -e '07 33'
with theascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …
– isomorphismes
Mar 10 '17 at 11:28
@isoe
or33
is the escape (ESC) character, which starts an escape sequence.]
starts an operating system command (OSC). For an xterm,0;
means "set the title", anda
or07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
– wjandrea
Feb 1 at 15:51
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
add a comment |
hi, I like your answer quite a lot. Would you mind explaining the role of]0;
in your code? I think I found the meaning ofecho -e '07 33'
with theascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …
– isomorphismes
Mar 10 '17 at 11:28
@isoe
or33
is the escape (ESC) character, which starts an escape sequence.]
starts an operating system command (OSC). For an xterm,0;
means "set the title", anda
or07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
– wjandrea
Feb 1 at 15:51
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
hi, I like your answer quite a lot. Would you mind explaining the role of
]0;
in your code? I think I found the meaning of echo -e '07 33'
with the ascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …– isomorphismes
Mar 10 '17 at 11:28
hi, I like your answer quite a lot. Would you mind explaining the role of
]0;
in your code? I think I found the meaning of echo -e '07 33'
with the ascii -o
command…although I’m truthfully not sure what that’s doing there either … thanks …– isomorphismes
Mar 10 '17 at 11:28
@iso
e
or 33
is the escape (ESC) character, which starts an escape sequence. ]
starts an operating system command (OSC). For an xterm, 0;
means "set the title", and a
or 07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences– wjandrea
Feb 1 at 15:51
@iso
e
or 33
is the escape (ESC) character, which starts an escape sequence. ]
starts an operating system command (OSC). For an xterm, 0;
means "set the title", and a
or 07
is the bell (BEL) character that terminates the OSC. More info: en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences– wjandrea
Feb 1 at 15:51
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
Solution 2 tested functional.
– Elder Geek
Feb 28 at 15:17
add a comment |
If you are a Ubuntu user, you can change the title of a gnome-terminal tab using the HUD.
While in the gnome-terminal, hit Alt to bring up the HUD, type the first few letters, e.g. "tit", hit enter and type in your new title.
This is a very quick method and avoids using the mouse.
1
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
theF2
key also avoids the mouse.
– isomorphismes
Mar 10 '17 at 11:31
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
add a comment |
If you are a Ubuntu user, you can change the title of a gnome-terminal tab using the HUD.
While in the gnome-terminal, hit Alt to bring up the HUD, type the first few letters, e.g. "tit", hit enter and type in your new title.
This is a very quick method and avoids using the mouse.
1
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
theF2
key also avoids the mouse.
– isomorphismes
Mar 10 '17 at 11:31
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
add a comment |
If you are a Ubuntu user, you can change the title of a gnome-terminal tab using the HUD.
While in the gnome-terminal, hit Alt to bring up the HUD, type the first few letters, e.g. "tit", hit enter and type in your new title.
This is a very quick method and avoids using the mouse.
If you are a Ubuntu user, you can change the title of a gnome-terminal tab using the HUD.
While in the gnome-terminal, hit Alt to bring up the HUD, type the first few letters, e.g. "tit", hit enter and type in your new title.
This is a very quick method and avoids using the mouse.
answered Jun 18 '13 at 6:55
TomTom
2,27742123
2,27742123
1
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
theF2
key also avoids the mouse.
– isomorphismes
Mar 10 '17 at 11:31
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
add a comment |
1
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
theF2
key also avoids the mouse.
– isomorphismes
Mar 10 '17 at 11:31
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
1
1
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
Indeed. Keeps the hands on the keyboard. The existing title is displayed, so it's fast and easy to also just modify the existing one using this method.
– Brent Faust
Dec 19 '13 at 0:39
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
tit is only for English Ubuntu.
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
and the whole option has been removed :(
– törzsmókus
Feb 22 '17 at 13:02
the
F2
key also avoids the mouse.– isomorphismes
Mar 10 '17 at 11:31
the
F2
key also avoids the mouse.– isomorphismes
Mar 10 '17 at 11:31
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
@törzsmókus And French - titre ;)
– wjandrea
Feb 1 at 15:56
add a comment |
Another way of changing the title of gnome-terminal
is by using gconftool-2
; this changes the initial terminal title for the profile selected, so you could have different profiles associated with titles such as 'Apache', 'Editing', etc. You would then launch gnome-terminal
with the appropriate profile to get the terminal title you had specified. This is in contrast to gnome-terminal --title "name"
which changes the title per terminal, but doesn't affect the initial title specified in the profile.
You could use the following command in a script to set the name of the terminal for a profile, and you could have the name of the terminal change at certain times in the day to remind you of things:
gconftool-2 --set /apps/gnome-terminal/profiles/Default/title --type=string "Apache"
This is for the default profile, but you could set the title for other profiles as well by changing, for example, Default
to another profile like Profile0
:
gconftool-2 --set /apps/gnome-terminal/profiles/Profile0/title --type=string "Editing"
I thought this way of changing the title is of use because of the way it could be used in scripting, or just as a quick command-line way to set the title for the profile. Note that sometimes you have to relaunch the terminal with the specified profile for the gconftool-2
setting to take affect. The complete settings available for gnome-terminal
can be listed with gconftool-2 -R /apps/gnome-terminal
.
add a comment |
Another way of changing the title of gnome-terminal
is by using gconftool-2
; this changes the initial terminal title for the profile selected, so you could have different profiles associated with titles such as 'Apache', 'Editing', etc. You would then launch gnome-terminal
with the appropriate profile to get the terminal title you had specified. This is in contrast to gnome-terminal --title "name"
which changes the title per terminal, but doesn't affect the initial title specified in the profile.
You could use the following command in a script to set the name of the terminal for a profile, and you could have the name of the terminal change at certain times in the day to remind you of things:
gconftool-2 --set /apps/gnome-terminal/profiles/Default/title --type=string "Apache"
This is for the default profile, but you could set the title for other profiles as well by changing, for example, Default
to another profile like Profile0
:
gconftool-2 --set /apps/gnome-terminal/profiles/Profile0/title --type=string "Editing"
I thought this way of changing the title is of use because of the way it could be used in scripting, or just as a quick command-line way to set the title for the profile. Note that sometimes you have to relaunch the terminal with the specified profile for the gconftool-2
setting to take affect. The complete settings available for gnome-terminal
can be listed with gconftool-2 -R /apps/gnome-terminal
.
add a comment |
Another way of changing the title of gnome-terminal
is by using gconftool-2
; this changes the initial terminal title for the profile selected, so you could have different profiles associated with titles such as 'Apache', 'Editing', etc. You would then launch gnome-terminal
with the appropriate profile to get the terminal title you had specified. This is in contrast to gnome-terminal --title "name"
which changes the title per terminal, but doesn't affect the initial title specified in the profile.
You could use the following command in a script to set the name of the terminal for a profile, and you could have the name of the terminal change at certain times in the day to remind you of things:
gconftool-2 --set /apps/gnome-terminal/profiles/Default/title --type=string "Apache"
This is for the default profile, but you could set the title for other profiles as well by changing, for example, Default
to another profile like Profile0
:
gconftool-2 --set /apps/gnome-terminal/profiles/Profile0/title --type=string "Editing"
I thought this way of changing the title is of use because of the way it could be used in scripting, or just as a quick command-line way to set the title for the profile. Note that sometimes you have to relaunch the terminal with the specified profile for the gconftool-2
setting to take affect. The complete settings available for gnome-terminal
can be listed with gconftool-2 -R /apps/gnome-terminal
.
Another way of changing the title of gnome-terminal
is by using gconftool-2
; this changes the initial terminal title for the profile selected, so you could have different profiles associated with titles such as 'Apache', 'Editing', etc. You would then launch gnome-terminal
with the appropriate profile to get the terminal title you had specified. This is in contrast to gnome-terminal --title "name"
which changes the title per terminal, but doesn't affect the initial title specified in the profile.
You could use the following command in a script to set the name of the terminal for a profile, and you could have the name of the terminal change at certain times in the day to remind you of things:
gconftool-2 --set /apps/gnome-terminal/profiles/Default/title --type=string "Apache"
This is for the default profile, but you could set the title for other profiles as well by changing, for example, Default
to another profile like Profile0
:
gconftool-2 --set /apps/gnome-terminal/profiles/Profile0/title --type=string "Editing"
I thought this way of changing the title is of use because of the way it could be used in scripting, or just as a quick command-line way to set the title for the profile. Note that sometimes you have to relaunch the terminal with the specified profile for the gconftool-2
setting to take affect. The complete settings available for gnome-terminal
can be listed with gconftool-2 -R /apps/gnome-terminal
.
edited Jan 3 '13 at 2:22
answered Jan 3 '13 at 1:09
user76204
add a comment |
add a comment |
Another solution is to use xdotool to simulate keystrokes, maybe useful in scripts:
Set a keyboard shortcut in gnome-terminal:
Edit > Keyboard Shortcuts... > Terminal > Set Title
For example assing the
Shift+Ctrl+Y
.
Install
xdotool
if you don't have it already:
sudo apt-get install xdotool
The following sequence of commands (that you can use also in a bash script) will set the terminal/tab title (escape the spaces with
):
xdotool key ctrl+shift+y
xdotool type My new fabulous title
xdotool key Return
[optional] You can also use xdotool to e.g. open a new tab and set the title with the above commands, using:
xdotool key ctrl+shift+t
Consider adding a sleep time before and after opening a new tab, e.g.
sleep 1
(to wait for 1 second).
This is not the most elegant solution, but it worked for me! The previous answers did not work in my case. I use gnome-terminal in Ubuntu 14.04 and I wanted to make a bash script.
add a comment |
Another solution is to use xdotool to simulate keystrokes, maybe useful in scripts:
Set a keyboard shortcut in gnome-terminal:
Edit > Keyboard Shortcuts... > Terminal > Set Title
For example assing the
Shift+Ctrl+Y
.
Install
xdotool
if you don't have it already:
sudo apt-get install xdotool
The following sequence of commands (that you can use also in a bash script) will set the terminal/tab title (escape the spaces with
):
xdotool key ctrl+shift+y
xdotool type My new fabulous title
xdotool key Return
[optional] You can also use xdotool to e.g. open a new tab and set the title with the above commands, using:
xdotool key ctrl+shift+t
Consider adding a sleep time before and after opening a new tab, e.g.
sleep 1
(to wait for 1 second).
This is not the most elegant solution, but it worked for me! The previous answers did not work in my case. I use gnome-terminal in Ubuntu 14.04 and I wanted to make a bash script.
add a comment |
Another solution is to use xdotool to simulate keystrokes, maybe useful in scripts:
Set a keyboard shortcut in gnome-terminal:
Edit > Keyboard Shortcuts... > Terminal > Set Title
For example assing the
Shift+Ctrl+Y
.
Install
xdotool
if you don't have it already:
sudo apt-get install xdotool
The following sequence of commands (that you can use also in a bash script) will set the terminal/tab title (escape the spaces with
):
xdotool key ctrl+shift+y
xdotool type My new fabulous title
xdotool key Return
[optional] You can also use xdotool to e.g. open a new tab and set the title with the above commands, using:
xdotool key ctrl+shift+t
Consider adding a sleep time before and after opening a new tab, e.g.
sleep 1
(to wait for 1 second).
This is not the most elegant solution, but it worked for me! The previous answers did not work in my case. I use gnome-terminal in Ubuntu 14.04 and I wanted to make a bash script.
Another solution is to use xdotool to simulate keystrokes, maybe useful in scripts:
Set a keyboard shortcut in gnome-terminal:
Edit > Keyboard Shortcuts... > Terminal > Set Title
For example assing the
Shift+Ctrl+Y
.
Install
xdotool
if you don't have it already:
sudo apt-get install xdotool
The following sequence of commands (that you can use also in a bash script) will set the terminal/tab title (escape the spaces with
):
xdotool key ctrl+shift+y
xdotool type My new fabulous title
xdotool key Return
[optional] You can also use xdotool to e.g. open a new tab and set the title with the above commands, using:
xdotool key ctrl+shift+t
Consider adding a sleep time before and after opening a new tab, e.g.
sleep 1
(to wait for 1 second).
This is not the most elegant solution, but it worked for me! The previous answers did not work in my case. I use gnome-terminal in Ubuntu 14.04 and I wanted to make a bash script.
edited Nov 12 '15 at 18:25
answered Nov 12 '15 at 17:55
MakisHMakisH
613725
613725
add a comment |
add a comment |
To display only the current working directory in the title, try this in your '.bashrc' :
PROMPT_COMMAND='echo -ne "33]0; ${PWD##*/}07"'
or
PROMPT_COMMAND='echo -ne "33]0;$(basename ${PWD})07"'
add a comment |
To display only the current working directory in the title, try this in your '.bashrc' :
PROMPT_COMMAND='echo -ne "33]0; ${PWD##*/}07"'
or
PROMPT_COMMAND='echo -ne "33]0;$(basename ${PWD})07"'
add a comment |
To display only the current working directory in the title, try this in your '.bashrc' :
PROMPT_COMMAND='echo -ne "33]0; ${PWD##*/}07"'
or
PROMPT_COMMAND='echo -ne "33]0;$(basename ${PWD})07"'
To display only the current working directory in the title, try this in your '.bashrc' :
PROMPT_COMMAND='echo -ne "33]0; ${PWD##*/}07"'
or
PROMPT_COMMAND='echo -ne "33]0;$(basename ${PWD})07"'
edited Mar 16 '14 at 5:52
answered Mar 16 '14 at 5:47
SriramSriram
1695
1695
add a comment |
add a comment |
This worked in my Gnome Terminal 3.18.3.
Edit your .bashrc file and add this function
# Update gnome terminal title
function termtitle() {
# take argument
TITLE=$1
shift
# update title
PROMPT_COMMAND='echo -ne "33]0; $TITLE 07"'
}
Don't forget to source
your .bashrc file
$ source ~/.bashrc
And then you can simply update you'll be able to change terminal title like this:
$ termtitle "MariaDB CLI"
add a comment |
This worked in my Gnome Terminal 3.18.3.
Edit your .bashrc file and add this function
# Update gnome terminal title
function termtitle() {
# take argument
TITLE=$1
shift
# update title
PROMPT_COMMAND='echo -ne "33]0; $TITLE 07"'
}
Don't forget to source
your .bashrc file
$ source ~/.bashrc
And then you can simply update you'll be able to change terminal title like this:
$ termtitle "MariaDB CLI"
add a comment |
This worked in my Gnome Terminal 3.18.3.
Edit your .bashrc file and add this function
# Update gnome terminal title
function termtitle() {
# take argument
TITLE=$1
shift
# update title
PROMPT_COMMAND='echo -ne "33]0; $TITLE 07"'
}
Don't forget to source
your .bashrc file
$ source ~/.bashrc
And then you can simply update you'll be able to change terminal title like this:
$ termtitle "MariaDB CLI"
This worked in my Gnome Terminal 3.18.3.
Edit your .bashrc file and add this function
# Update gnome terminal title
function termtitle() {
# take argument
TITLE=$1
shift
# update title
PROMPT_COMMAND='echo -ne "33]0; $TITLE 07"'
}
Don't forget to source
your .bashrc file
$ source ~/.bashrc
And then you can simply update you'll be able to change terminal title like this:
$ termtitle "MariaDB CLI"
answered Oct 23 '17 at 9:06
RousseauAlexandreRousseauAlexandre
1436
1436
add a comment |
add a comment |
In case any poor souls like myself are forced to use tcsh, try something like this in your .cshrc:
set prompt='%{33]0;%n@%m07%}%~%# '
Source and more details: http://tldp.org/HOWTO/Xterm-Title-4.html
add a comment |
In case any poor souls like myself are forced to use tcsh, try something like this in your .cshrc:
set prompt='%{33]0;%n@%m07%}%~%# '
Source and more details: http://tldp.org/HOWTO/Xterm-Title-4.html
add a comment |
In case any poor souls like myself are forced to use tcsh, try something like this in your .cshrc:
set prompt='%{33]0;%n@%m07%}%~%# '
Source and more details: http://tldp.org/HOWTO/Xterm-Title-4.html
In case any poor souls like myself are forced to use tcsh, try something like this in your .cshrc:
set prompt='%{33]0;%n@%m07%}%~%# '
Source and more details: http://tldp.org/HOWTO/Xterm-Title-4.html
answered May 2 '17 at 11:11
spookypeanutspookypeanut
183110
183110
add a comment |
add a comment |
If you are using gnome 3, the convenient Terminal > Set Title
menu option has been removed. You can install a gnome 2 forked terminal which still has that "Set Title" menu option, and run that instead:
sudo apt-get install mate-terminal
Instead of running "Terminal", run "MATE Terminal". You should probably also select mate-terminal in sudo update-alternatives --config x-terminal-emulator
.
add a comment |
If you are using gnome 3, the convenient Terminal > Set Title
menu option has been removed. You can install a gnome 2 forked terminal which still has that "Set Title" menu option, and run that instead:
sudo apt-get install mate-terminal
Instead of running "Terminal", run "MATE Terminal". You should probably also select mate-terminal in sudo update-alternatives --config x-terminal-emulator
.
add a comment |
If you are using gnome 3, the convenient Terminal > Set Title
menu option has been removed. You can install a gnome 2 forked terminal which still has that "Set Title" menu option, and run that instead:
sudo apt-get install mate-terminal
Instead of running "Terminal", run "MATE Terminal". You should probably also select mate-terminal in sudo update-alternatives --config x-terminal-emulator
.
If you are using gnome 3, the convenient Terminal > Set Title
menu option has been removed. You can install a gnome 2 forked terminal which still has that "Set Title" menu option, and run that instead:
sudo apt-get install mate-terminal
Instead of running "Terminal", run "MATE Terminal". You should probably also select mate-terminal in sudo update-alternatives --config x-terminal-emulator
.
answered Nov 27 '18 at 6:28
JDiMatteoJDiMatteo
1409
1409
add a comment |
add a comment |
protected by Community♦ Jan 5 '15 at 18:01
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Further to Ward's comment: Don't forget to "unset PROMPT_COMMAND" before you send the title-change escape sequence, otherwise any change you make will be lost as soon as the next shell prompt.
– Jon Green
Sep 2 '11 at 11:38
For a similar question for KDE, see stackoverflow.com/questions/8782159/…
– naught101
May 29 '12 at 2:22
I had this issue when switching from OS X to Ubuntu. To obtain custom titles within a multi-tab set-up, I used
gnome-terminal --load-config
together with this script I've written.– halfer
Apr 13 '14 at 1:29
3
add following to your .bashrc file in your home dir
# set title of current terminal setTerminalTitle(){ echo -ne "33]0;${1}07" } alias termttl=setTerminalTitle
now you can use termttl alias for setting title e.g.termttl askubuntu
– urmalp
Oct 11 '15 at 5:33