{"head":"3d791926a65118c9119f1f0506e79351dff5dbb7","size":1,"push_id":47125797,"ref":"refs/heads/master","commits":[{"sha":"3d791926a65118c9119f1f0506e79351dff5dbb7","author":{"name":"Mathias Bynens","email":"17a2cbc4e33156874a9862b0f530521117e66a3d@qiwi.be"},"url":"https://api.github.com/repos/mathiasbynens/dotfiles/commits/3d791926a65118c9119f1f0506e79351dff5dbb7","message":"Don’t source .bash_profile when PS1 is not set (for non-interactive shells).\r\n\r\nStolen from @janmoesen’s https://github.com/janmoesen/tilde/blob/master/.bashrc:\r\n\r\n# This might seem backwards when you look at the \"Bash startup files\" reference\r\n# <http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files> or\r\n# the \"INVOCATION\" section in the man page. However, my workflow typically is:\r\n#\r\n# * Open a terminal with four shells in tabs\r\n# * Edit code in Vim, and shell out using \":sh\"\r\n#\r\n# The initial four shells are login shells, so they source ~/.bash_profile.\r\n# The shells spawned by Vim are not login shells, but they /are/ interactive.\r\n# They look for .bashrc, but not .bash_profile. Because they are interactive,\r\n# PS1 is set, so I know it is OK to run all the shell initialisation code.\r\n#\r\n# If I were to put the contents of ~/.bash_profile in ~/.bashrc and make the\r\n# former source the latter, I would have to wrap the entire contents of the\r\n# latter in a huge \"if [ -n \"$PS1\" ]; then ... fi\" block. That does not really\r\n# help readability, does it?\r\n#\r\n# The difference between a login shell and an interactive non-login shell is\r\n# moot for me, so I consider all interactive shells to be equal and wanting\r\n# the same treatment.\r\n#\r\n# If you're wondering what a non-interactive shell might be, i.e. when PS1\r\n# might not be set, try this:\r\n#\r\n#     ssh localhost 'echo \"PS1: >$PS1<\"'\r\n#"}],"legacy":{"head":"3d791926a65118c9119f1f0506e79351dff5dbb7","size":1,"push_id":47125797,"shas":[["3d791926a65118c9119f1f0506e79351dff5dbb7","mathias@qiwi.be","Don’t source .bash_profile when PS1 is not set (for non-interactive shells).\r\n\r\nStolen from @janmoesen’s https://github.com/janmoesen/tilde/blob/master/.bashrc:\r\n\r\n# This might seem backwards when you look at the \"Bash startup files\" reference\r\n# <http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files> or\r\n# the \"INVOCATION\" section in the man page. However, my workflow typically is:\r\n#\r\n# * Open a terminal with four shells in tabs\r\n# * Edit code in Vim, and shell out using \":sh\"\r\n#\r\n# The initial four shells are login shells, so they source ~/.bash_profile.\r\n# The shells spawned by Vim are not login shells, but they /are/ interactive.\r\n# They look for .bashrc, but not .bash_profile. Because they are interactive,\r\n# PS1 is set, so I know it is OK to run all the shell initialisation code.\r\n#\r\n# If I were to put the contents of ~/.bash_profile in ~/.bashrc and make the\r\n# former source the latter, I would have to wrap the entire contents of the\r\n# latter in a huge \"if [ -n \"$PS1\" ]; then ... fi\" block. That does not really\r\n# help readability, does it?\r\n#\r\n# The difference between a login shell and an interactive non-login shell is\r\n# moot for me, so I consider all interactive shells to be equal and wanting\r\n# the same treatment.\r\n#\r\n# If you're wondering what a non-interactive shell might be, i.e. when PS1\r\n# might not be set, try this:\r\n#\r\n#     ssh localhost 'echo \"PS1: >$PS1<\"'\r\n#","Mathias Bynens"]],"ref":"refs/heads/master"}}