1# System-wide .bashrc file for interactive bash(1) shells. 2if [ -z "$PS1" ]; then 3 return 4fi 5 6PS1='\h:\W \u\$ ' 7# Make bash check its window size after a process completes 8shopt -s checkwinsize 9# Tell the terminal about the working directory at each prompt. 10if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then 11 update_terminal_cwd() { 12 # Identify the directory using a "file:" scheme URL, 13 # including the host name to disambiguate local vs. 14 # remote connections. Percent-escape spaces. 15 local SEARCH=' ' 16 local REPLACE='%20' 17 local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" 18 printf '\e]7;%s\a' "$PWD_URL" 19 } 20 PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND" 21fi 22 23