The command being composed is saved when navigating history.

If you start typing, hit the up arrow to view the previous command, and hit the down arrow, what you had typed will be preserved and show up again.