ddworken / hishtory

Your shell history: synced, queryable, and in context
https://hishtory.dev
MIT License
2.46k stars 45 forks source link

`set -o nounset` causes `unbound variable` warnings #142

Closed mustafa0x closed 9 months ago

mustafa0x commented 9 months ago

With source ~/.hishtory/config.sh in .bashrc.

$> set -u
-bash: HISHTORY_AT_PROMPT: unbound variable
-bash: HISHTORY_FIRST_PROMPT: unbound variable

Reason:

https://github.com/ddworken/hishtory/blob/cc123854a02374a7e4ee7fc87a974b19566fa142/client/lib/config.sh#L10

Solutions: https://stackoverflow.com/questions/7832080/test-if-a-variable-is-set-in-bash-when-using-set-o-nounset

ddworken commented 9 months ago

This should be fixed! If you run hishtory update you'll get the latest version with the fix. If you're still experiencing this issue (or run into anything else!) please reopen this so I can take another look.

mustafa0x commented 9 months ago

Seems to be working; thanks for the quick fix @ddworken!