[zsh] Set a file URL in the Apple Terminal title

This commit is contained in:
Eryn Wells 2017-01-31 22:57:45 -08:00
parent 694e038b63
commit 932aac1928

View file

@ -132,10 +132,13 @@ function set_xterm_title
# Set xterm and screen titles # Set xterm and screen titles
if [[ -n "$DISPLAY" || -n "$TERM_PROGRAM" ]]; then if [[ -n "$DISPLAY" || -n "$TERM_PROGRAM" ]]; then
title+="%n@%m" print -Pn "\e]2;%n@%m\a"
fi fi
print -Pn "\e]2;${title}\a" # For Apple Terminal.app, add a link to the current directory.
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
print -Pn "\e]7;file://%d\a"
fi
} }