Skip to content

Commit

Permalink
M dot_bashrc.d/10-hishtory.sh
Browse files Browse the repository at this point in the history
M  dot_bashrc.d/10-hishtory.zsh
  • Loading branch information
justmiles committed Mar 6, 2024
1 parent fc813df commit c232d7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dot_bashrc.d/10-hishtory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if [ ! "$(ps -p $$ -ocomm=)" "==" "bash" ]; then return; fi
# only run this if hishtory is installed
if [ ! -x "/etc/profiles/per-user/$USER/bin/hishtory" ]; then return; fi

# only run this if hishtory is configured
if [ ! -d "$HOME/.hishtory" ]; then return; fi

# Include guard. This file is sourced in multiple places, but we want it to only execute once.
# This trick is from https://stackoverflow.com/questions/7518584/is-there-any-mechanism-in-shell-script-alike-include-guard-in-c
if [ -n "$__hishtory_bash_config_sourced" ]; then return; fi
Expand Down
3 changes: 3 additions & 0 deletions dot_bashrc.d/10-hishtory.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ if [ ! "$(ps -p $$ -ocomm=)" "==" "zsh" ]; then return; fi
# only run this if hishtory is installed
if [ ! -x "/etc/profiles/per-user/$USER/bin/hishtory" ]; then return; fi

# only run this if hishtory is configured
if [ ! -d "$HOME/.hishtory" ]; then return; fi

autoload -U add-zsh-hook
add-zsh-hook zshaddhistory _hishtory_add
add-zsh-hook precmd _hishtory_precmd
Expand Down

0 comments on commit c232d7a

Please sign in to comment.