larkery / zsh-histdb

A slightly better history for zsh
MIT License
1.25k stars 74 forks source link

[MacOS] zsh: histdb-update-outcome: function definition file not found #115

Open antwal opened 2 years ago

antwal commented 2 years ago

Hi,

the plugins not working on my install, but not understand:

~ > sqlite3 -version
3.36.0 2021-06-18 18:36:39

~ > zsh --version
zsh 5.7.1 (x86_64-apple-darwin19.0)

my steps:

git clone https://github.com/larkery/zsh-histdb $HOME/.oh-my-zsh/custom/plugins/zsh-histdb
echo "HISTDB_TABULATE_CMD=(sed -e $'s/\x1f/\t/g')" >> $HOME/.zshrc
source $HOME/.oh-my-zsh/custom/plugins/zsh-histdb/sqlite-history.zsh
autoload -Uz add-zsh-hook

when type any commands i receive the error:

zsh: histdb-update-outcome: function definition file not found

my db folder:

~/.histdb > ls -al
total 4256
drwxr-xr-x   5 antwal  staff      160 29 Ott 01:24 .
drwxr-xr-x+ 45 antwal  staff     1440 29 Ott 01:42 ..
-rw-r--r--   1 antwal  staff    45056 29 Ott 01:24 zsh-history.db
-rw-r--r--   1 antwal  staff    32768 29 Ott 01:24 zsh-history.db-shm
-rw-r--r--   1 antwal  staff  1701592 29 Ott 01:42 zsh-history.db-wal

Thanks.

antwal commented 2 years ago

Hi,

I found the problem and solved it by modifying the plugin:

replace this line:

https://github.com/larkery/zsh-histdb/blob/0b63f7c9f6748a1fa65b8d8e4508146da2c59087/sqlite-history.zsh#L176

with:

precmd_functions+=(histdb-update-outcome)

the problem is solved and everything works correctly

Thanks.