terminalapp.plugin.zsh 254 B

1234567891011
  1. # Set Apple Terminal.app resume directory
  2. # based on this answer: http://superuser.com/a/315029
  3. function chpwd {
  4. local SEARCH=' '
  5. local REPLACE='%20'
  6. local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
  7. printf '\e]7;%s\a' "$PWD_URL"
  8. }
  9. chpwd