diff --git a/.bashrc b/.bashrc
index 99538bda4078488b7238fee1f86b73f9d00c19b0..66f49de7830262c010630d5d298c618fb16677bb 100644
--- a/.bashrc
+++ b/.bashrc
@@ -136,7 +136,6 @@ alias restart-kodi='ssh kodi.shore.co.il "sudo systemctl kill --kill-who=all --s
 # shellcheck disable=SC2032
 alias rm='rm --dir'
 alias screenshot-cleanup='find "$HOME/Pictures" -name "Screenshot from *.png" -delete'
-alias set_title='printf "\033]0;%s\007"'
 alias smtp-server='python3 -m smtpd -ndc DebuggingServer'
 alias sudo="sudo "
 alias sudome="sudome "
@@ -207,6 +206,12 @@ prune_ssh_sockets () {
         -execdir sh -c 'lsof -t "$1" >/dev/null || rm "$1"' _ {} \;
 }
 
+set_title () {
+    local default_title
+    default_title="$(basename "$PWD")"
+    printf "\033]0;%s\007" "${1:-$default_title}"
+}
+
 ssh_keyscan_add () {
     ssh-keyscan "$@" >> "$HOME/.ssh/known_hosts"
     sort -uo "$HOME/.ssh/known_hosts" "$HOME/.ssh/known_hosts"