Skip to content

Instantly share code, notes, and snippets.

@gustavomdsantos
Created May 24, 2025 16:01
Show Gist options
  • Save gustavomdsantos/1e8e28191220f2e5ffe023b136968bee to your computer and use it in GitHub Desktop.
Save gustavomdsantos/1e8e28191220f2e5ffe023b136968bee to your computer and use it in GitHub Desktop.
~/.bashrc snippet for changing window terminal title. Original source: https://www.baeldung.com/linux/current-tab-title
function set-title() {
if [[ -z "$ORIG" ]]; then
ORIG=$PS1
fi
TITLE="\[\e]2;$*\a\]"
PS1=${ORIG}${TITLE}
}
set-title "Terminal - $PWD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment