solved three major problems: history now persisting, console not losing terminal focus on startup, and locking due to exceptions on traversal iterators.