From a28b8889ee80856b65dd792dedd7735a1b94443c Mon Sep 17 00:00:00 2001 From: Alexander Madyankin Date: Thu, 5 Jan 2012 11:16:17 +0600 Subject: [PATCH] Apple Terminal.app resume directory plugin --- plugins/terminalapp/terminalapp.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/terminalapp/terminalapp.plugin.zsh diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh new file mode 100644 index 000000000..4695ad055 --- /dev/null +++ b/plugins/terminalapp/terminalapp.plugin.zsh @@ -0,0 +1,11 @@ +# Set Apple Terminal.app resume directory +# based on this answer: http://superuser.com/a/315029 + +function chpwd { + local SEARCH=' ' + local REPLACE='%20' + local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" + printf '\e]7;%s\a' "$PWD_URL" +} + +chpwd \ No newline at end of file