History missing if multiple shells open #1412
Unanswered
Sripadvallabh
asked this question in
Q&A
Replies: 1 comment
-
You can run as many instances as you want as long as they are started from different locations in your filesystem. Each instance reads the history from a fixed relative path on startup and writes the history back to the same fixed relative location on shutdown. This works great for the use case where you have a single user running at different times. If you have multiple users running simultaneously, we support that as long as they are launching the application from a different directory path. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When running multiple shell sessions, it looks like history from one session can be lost. This seems to happen because each session downloads the history from file on startup & maintains this own version of the history and writes it to the file upon exit.
From what I’ve checked in the code, cmd2 stores the entire history in self.history, but it doesn’t appear to read the file contents & then append the extra cmd history into the file; it just writes its own version of the entire history onto the file. As a result, changes made in other sessions may get overwritten.
Beta Was this translation helpful? Give feedback.
All reactions