Sunday, October 18, 2015

How to rename the tab name in iTerm2

I like this one:

#setup terminal tab title
function title {
if [ "$1" ]
then
unset PROMPT_COMMAND
echo -ne "\033]0;${*}\007"
else
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
fi
}
title


It will let you toggle the name of a tab between a custom name and a default of your CWD.

title -> your tab title will be ~/YOUR_CWD/

title hey there -> your tab title will be hey there

No comments:

Post a Comment