Search code examples
bashcygwin

Cygwin function "settitle"


I was checking the .bashrc file that is installed by Cygwin and I found with a commented function named settitle:

settitle ()
{
   echo -ne "\e]2;$@\a\e]1;$@\a";
}

I would like to know what exactly does this function.


Solution

  • It changes the title of your window by outputting a special string, called an escape sequence. Read (a lot) more about ANSI escape sequences on Wikipedia, on the Bash Prompt HOWTO and at the ANSI escape sequence reference.