Created
July 24, 2019 13:01
-
-
Save fabienhinault/0e9451a30e387e2d93ef52930ec6a53b to your computer and use it in GitHub Desktop.
method to use to rename terminal tab when using a command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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