per-directory-history doesn't save to both global and local
Describe the bug
As stated in the original repository for this tool, whether you are in global history mode or per-directory history mode, the history should always be saved to both.
In my use I get the following behavior: When using local history, commands entered are not available when I switch to global history. When using global history, commands entered in a given directory do appear in the local history, but they show up at the back of the list even if typed more recently.
Steps to reproduce
- Enable plugin.
- Type some commands.
- Run
per-directory-history-toggle-historyto change modes. - Run
history | lessto view the history. In my case, the commands entered in 2 don't show up.
Expected behavior
When I switch history modes, commands entered in the previous mode should be listed as the most recent commands in the history of the new mode (provided I haven't also changed directories or run commands in another session).
OS / Linux distribution
Ubuntu 20.04.4 LTS
Zsh version
5.8
Terminal emulator
Tmux in Windows Terminal
Source: ohmyzsh/ohmyzsh