fn set_terminal( terminal_error: &Arc<Mutex<Option<Arc<Error>>>>, error: Error, ) -> Arc<Error>
Records error as the terminal error unless one is already recorded, and returns the recorded one.
error