Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

rename terminal tab title in ubuntu 20.04

## Create a function in ~/.bashrc:

function set-title() {
  if [[ -z "$ORIG" ]]; then
    ORIG=$PS1
  fi
  TITLE="[e]2;$*a]"
  PS1=${ORIG}${TITLE}
}

## Then run:
source ~/.bashrc

## Then use your new command to set the terminal title. It works with spaces in the name too:
set-title my new tab title
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #rename #terminal #tab #title #ubuntu
ADD COMMENT
Topic
Name
5+6 =