Swift: log a copy of the shell history