Advanced command history