Created
October 22, 2012 15:29
-
-
Save cap10morgan/3932077 to your computer and use it in GitHub Desktop.
Fix prezto tab titles in Terminal.app
This file contains 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
diff --git i/modules/terminal/init.zsh w/modules/terminal/init.zsh | |
index dc78a3b..d36b641 100644 | |
--- i/modules/terminal/init.zsh | |
+++ w/modules/terminal/init.zsh | |
@@ -85,14 +85,14 @@ function set-titles-with-path { | |
setopt EXTENDED_GLOB | |
local absolute_path="${${1:a}:-$PWD}" | |
+ local abbreviated_path="${absolute_path/#$HOME/~}" | |
+ local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}" | |
+ unset MATCH | |
if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]]; then | |
printf '\e]7;%s\a' "file://$HOST${absolute_path// /%20}" | |
+ set-terminal-tab-title "$truncated_path" | |
else | |
- local abbreviated_path="${absolute_path/#$HOME/~}" | |
- local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}" | |
- unset MATCH | |
- | |
if [[ "$TERM" == screen* ]]; then | |
set-screen-window-title "$truncated_path" | |
else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment