Skip to content

Commit

Permalink
Trivial change: Update comments in activate about what running hash -…
Browse files Browse the repository at this point in the history
…r does (GH-125385)

Update comments about what running hash -r does

The old comment said "hash -r" forgets "past commands." However, the documentation for "hash" states that it forgets past locations. The old comment was, in my opinion, confusing. This is because it could be interpreted to mean it does something to the command history (HISTORY/HISTFILE etc) vs the cache of locations.
  • Loading branch information
aathan authored Oct 13, 2024
1 parent a8fa4ad commit 82bcaf1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/venv/scripts/common/activate
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ deactivate () {
unset _OLD_VIRTUAL_PYTHONHOME
fi

# Call hash to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
# Call hash to forget past locations. Without forgetting
# past locations the $PATH changes we made may not be respected.
# See "man bash" for more details. hash is usually a builtin of your shell
hash -r 2> /dev/null

if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
Expand Down

0 comments on commit 82bcaf1

Please sign in to comment.