Scale apt history-list to the screen width
This merge request will make apt history-list extend the command line field based on the available screen width in the terminal. Additionally, it will optimize and refactor some other parts of the code for performance improvement.