terminalapp.plugin.zsh 254 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
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