larkery / zsh-histdb

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

Per-window history on up-arrow? #124

Closed linsomniac closed 2 years ago

linsomniac commented 2 years ago

I typically have many different shell windows open, and each window has it's own context (rclone syncing cloud storage in one, developing a program in another, doing devops in another). I love zsh-histdb for auto-suggestions of commands to run, or for searching through history, but when I do an "up arrow" to run the last command, I really want it to run the last command I ran in that window, not the last command I ran in any window.

I took a look at the zsh-histdb code, but I don't know enough about how zsh history works to figure out where I might be able to make this change. I didn't see any mention of this sort of feature in the README.

larkery commented 2 years ago

Up arrow in your shell has nothing to do with zsh-histdb, it doesn't touch this. I am guessing this is configurable in some way in the zsh normal history stuff, there are some settings in there about how to deal with multiple writers to history (the standard history that is)

If you wanted to make up arrow search histdb you could, but I haven't and probably won't.

linsomniac commented 2 years ago

Thank you, what I wanted was "setopt nosharehistory". This must have come from oh-my-zsh, which I installed at the same time as zsh-histdb, and I didn't realize it wasn't a feature of zsh-histdb.