From 932aac19283f87160d5902538754f7b9b3f6452e Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 31 Jan 2017 22:57:45 -0800 Subject: [PATCH] [zsh] Set a file URL in the Apple Terminal title --- zsh/func/prompt_loquacious_setup | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/func/prompt_loquacious_setup b/zsh/func/prompt_loquacious_setup index a1c95dc..04d9002 100644 --- a/zsh/func/prompt_loquacious_setup +++ b/zsh/func/prompt_loquacious_setup @@ -132,10 +132,13 @@ function set_xterm_title # Set xterm and screen titles if [[ -n "$DISPLAY" || -n "$TERM_PROGRAM" ]]; then - title+="%n@%m" + print -Pn "\e]2;%n@%m\a" 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 }