You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filtering by command is great, but how about also filtering by currently active directory?
I've quickly hammered something into place that works using preexec...
# Added to end of ~/.bashrc__peri_filter_preexec() { if [[ "${PWD}"=~ .*Private.* ]] ;then __BH_SAVE_COMMAND='';fi }
if [ -f~/.bashhub/deps/bash-preexec.sh ];thensource~/.bashhub/deps/bash-preexec.sh ; preexec_functions+=(__peri_filter_preexec);fi
Prevents saving any command while active in any path containing the word Private
But this feels a bit iffy, would prefer not to have to use internal bashhub variables, etc, etc
The text was updated successfully, but these errors were encountered:
@Perilin thanks for the feedback and example using preexec!
This would actually be a pretty straight forward change. I think this could be implemented via the config (i.e. ~/.bashhub/config) as a regex similar to the existing command filter. You could also check or edit it via the bashhub filter command.
Any interest in submitting a PR? You could template from how I built the command filter in a4a0c75ea04d160.
Filtering by command is great, but how about also filtering by currently active directory?
I've quickly hammered something into place that works using preexec...
Prevents saving any command while active in any path containing the word Private
But this feels a bit iffy, would prefer not to have to use internal bashhub variables, etc, etc
The text was updated successfully, but these errors were encountered: