Strip whitespace
Add line to history