6

This question already has an answer here:

Edit : other answer talked about change the title of the terminal, not a tab, but effectively they answer to my question too. Everything is great.

I'm a newbie and I wonder how give a specific name to a terminal tab instance ?

Here an instance of my question :

instance : two tabs with custom names

Currently I have just few knowledge in Ubuntu system. Thanks

marked as duplicate by WinEunuuchs2Unix, dessert command-line Jun 8 '18 at 14:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

I wrote a function for that once.

setTitle() {
    echo -e "\033]0;$@\007" 
}

Alternatively, one could use

 "\033]0;$@\a"

Using that in conjunction with PROMPT_COMMAND variable in ~/.bashrc or PS1 variable, you can do something like this:

PS1="$PS1$(setTitle $(date) )"

What this does is thatbit adds timestamp to title of the terminal each time you propt redrawing is called. So each of your tabs can have timestamp the last command got executed.

From there, you can add other forms of commands in $() instead of date. Or have it be called from ~/.bashrc once at the end of the file to only have non changing prompt through the session but unique for each tab.

See also: How to change the title of the current terminal tab using only the command line

Not the answer you're looking for? Browse other questions tagged or ask your own question.