def get_history_items(): num_items = readline.get_current_history_length() + 1 return [ readline.get_history_item(i) for i in range(1, num_items) ]