Hacker News new | ask | show | jobs
by UncleOxidant 485 days ago
This looks promising, thanks!
1 comments

For bash, you may be able to do something like:

  function set_histfile {
    export HISTFILE="$HOME/.bash_history_$(pwd | tr '/' '_')"
  }

  PROMPT_COMMAND="set_histfile; $PROMPT_COMMAND"
There may be other ways, but probably can't do it without PROMPT_COMMAND.

Someone else mentioned "direnv", too.