You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fish wants to use a single history file, but also ignore item from other sessions that were ran after this session was started. To achieve this it compares the item's timestamp against the current clock. The problem is that if the clock is invalid or set backwards, then old items may appear new and will be ignored.
The real problem is that fish ever re-reads the file. What ought to happen is that fish uses whatever is in the file at session startup or when history merge is run, and then ignores the timestamp.
But that implies that we will be forced to ingest all history (or at least all that we can ever reference in the session without merging) and load it into memory? A more reliable alternative to the timestamps is a strictly globally monotonic session id identifier, but a more reasonable approach might be to just remember the length of the file/the seek position at startup.
No, it does not need to read the file, it only has to mmap it with MAP_PRIVATE. The file will still be lazily paged-in on demand. The open/lseek approach would also work; in fact, it might be even better since it would avoid the issue where truncated mapped files cause SIGBUS.
fish wants to use a single history file, but also ignore item from other sessions that were ran after this session was started. To achieve this it compares the item's timestamp against the current clock. The problem is that if the clock is invalid or set backwards, then old items may appear new and will be ignored.
The real problem is that fish ever re-reads the file. What ought to happen is that fish uses whatever is in the file at session startup or when
history merge
is run, and then ignores the timestamp.Credit to @travankor for pointing this out.
The text was updated successfully, but these errors were encountered: