fixed /history bug and bug with arrow key

/history now displays correctly the history of the commands the user
typed.

Also, user does not have to type the up arrow key twice to get to the
previous command typed.