Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Created July 24, 2019 13:01
Show Gist options
  • Save fabienhinault/0e9451a30e387e2d93ef52930ec6a53b to your computer and use it in GitHub Desktop.
Save fabienhinault/0e9451a30e387e2d93ef52930ec6a53b to your computer and use it in GitHub Desktop.
method to use to rename terminal tab when using a command.
tabname() {
if [[ $PROMPT_COMMAND =~ echo\ -en\ \"\\033]0\;\ $1\ \\a\"$ ]]
then
return 0
else
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }echo -en \"\\033]0; $1 \\a\""
return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment