aboutsummaryrefslogtreecommitdiffhomepage
path: root/history.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-07-25 10:08:21 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-07-25 10:49:12 -0700
commite9f870e25af2fb8bf2dfbf5c92faaff667fd4cc1 (patch)
tree9ff028b8fc75082a7b5a605ea04cbef8036a73b2 /history.h
parent317660c2fe71dbbb31c85aa313f669f55c2f8df7 (diff)
Add support for history --merge to incorporate history changes from
other sessions. Fixes #825
Diffstat (limited to 'history.h')
-rw-r--r--history.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/history.h b/history.h
index e6d48682..5b7292e8 100644
--- a/history.h
+++ b/history.h
@@ -154,8 +154,8 @@ private:
/** The file ID of the file we mmap'd */
file_id_t mmap_file_id;
- /** Timestamp of when this history was created */
- const time_t birth_timestamp;
+ /** The boundary timestamp distinguishes old items from new items. Items whose timestamps are <= the boundary are considered "old". Items whose timestemps are > the boundary are new, and are ignored by this instance (unless they came from this instance). The timestamp may be adjusted by incorporate_external_changes() */
+ time_t boundary_timestamp;
/** How many items we add until the next vacuum. Initially a random value. */
int countdown_to_vacuum;
@@ -233,6 +233,9 @@ public:
/** Populates from a bash history file */
void populate_from_bash(FILE *f);
+ /** Incorporates the history of other shells into this history */
+ void incorporate_external_changes();
+
/* Gets all the history into a string with ARRAY_SEP_STR. This is intended for the $history environment variable. This may be long! */
void get_string_representation(wcstring &str, const wcstring &separator);