4 ms·
I had thought that too, but, interestingly enough, this doesn't seem to be the case. ~/.local/share/fish/fish_history does not include the cwd. In fact it seem
by wzdd 5y ago
I had thought that too, but, interestingly enough, this doesn't seem to be the case. ~/.local/share/fish/fish_history does not include the cwd.
In fact it seems like Fish does something better: when adding to the history, it sees if any of the arguments to the command are valid file paths. These are stored separately. Fish will then autocomplete the command if detected paths are valid.
So for example if you run "git log somefile", whenever "somefile" is in your cwd you will get an autocompletion for that command.
This matches the documentation (https://fishshell.com/docs/current/interactive.html#history-search https://fishshell.com/docs/current/interactive.html#history-...) which says "fish suggests commands as you type, based on command history, completions, and valid file paths".
- ianlevesque 5y agoNeat. That is even better.